Skip to main content

OAuthBrowser is module to do authentications and web scraping.

Project description


This module will let you authenticate OAuth 2.0 via system browser and get response URL. Currently supporting Google Chrome and Safari browsers. Built with applescript and osascript, only works on Mac OSX.

A lot more can be done with OAuthBrowser like getting source code without getting automation detection from websites.


Use the package manager pip to install OAuthBrowser.

pip install OAuthBrowser

Or install the latest repo from here.

pip install git+


Usage is very simple

  1. Pass authentication URL.
  2. Apply Wait class to wait for the browser to redirect.
  3. Fetch URL.
  4. Close browser.
from OAuthBrowser import Safari, Wait
from urllib.parse import urlparse, parse_qs

URL = """

# Initialise browser
browser = Safari(window_geometry=(100, 22, 400, 690))
# Pass Authentication URL
# Initialise Wait
wait = Wait(browser)
# Wait till query "code" is present in the URL.
# Fetch the url
response_url = urlparse(browser.get_current_url())
code = parse_qs(response_url.query).get('code')[0]
print("\nCode: %s\n" % code)
# Close the browser


python -m OAuthBrowser


When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method of this repository before making a change.

Please make sure to update tests as appropriate.




  • 0.0.1
    • First import.

Download files

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

Source Distribution

OAuthBrowser-0.0.1.tar.gz (6.1 kB view hashes)

Uploaded source

Built Distribution

OAuthBrowser-0.0.1-py2-none-any.whl (7.6 kB view hashes)

Uploaded py2

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page