Skip to main content
Join the official 2020 Python Developers SurveyStart the survey!

A small HTTP browser library in Python based on the 'requests' library

Project description

Grace to you and peace from God our Father and the Lord Jesus Christ.

I give thanks to my God always for you because of the grace of God that was given you in Christ Jesus, that in every way you were enriched in him in all speech and all knowledge— even as the testimony about Christ was confirmed among you— so that you are not lacking in any gift, as you wait for the revealing of our Lord Jesus Christ, who will sustain you to the end, guiltless in the day of our Lord Jesus Christ. God is faithful, by whom you were called into the fellowship of his Son, Jesus Christ our Lord.

smallbrowser

pip install smallbrowser

A small HTTP browser library in Python based on the requests library.

Dependency

All due credits to requests and pyquery Python libraries.

Concept

This library is only composed of five (5) methods.

  1. Browser#type(String url)
  2. Browser#enter()
  3. Browser#fillup(dict form)
  4. Browser#submit()
  5. Browser#response

Similar to what you do with a browser, you type the URL and press enter to load the URL. Then, you will get a response back. When there is a form, you fill up the form and click submit.

Usage

The code below will print out the raw HTML of https://www.google.com website.

from smallbrowser import Browser

browser = Browser("browser.storage")
response = browser.type("https://www.google.com").enter().response
print(response.text)

The Browser#response is the return object from requests library. When initializing the Browser object, you need to pass a path to a directory, which is named browser.storage. This directory is automatically created by the library. This will contain session information so that your session may be saved.

For debugging purposes, you may open the browser.storage/contents and browser.storage/responses directory that contains information about all your visited websites.

GLORY BE TO OUR LORD JESUS CHRIST. JESUS LOVES YOU.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for smallbrowser, version 0.1.9
Filename, size File type Python version Upload date Hashes
Filename, size smallbrowser-0.1.9-py3-none-any.whl (16.0 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size smallbrowser-0.1.9.tar.gz (3.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page