Instabrade
Selenium based Instagram scraper
Note that is project is currently in alpha: APIs can and will change without warning.
Currently support functionality:
Log into Instagram
Handle the mobile app related popups
Planned functionality in upcoming release(s):
Return all posts from Home page
Example usage:
from selenium import webdriver
from instabrade import Instagram
my_username = "my username"
my_password = "my password"
driver = webdriver.Chrome()
try:
# Instantiate the object
# - This also loads instagram's URL
ig = Instagram(driver)
# Click the "Log in" link to display the login fields
ig.log_in_page.log_in_link_click()
# Fill in the username and password fields
ig.log_in_page.log_in_username = my_username
ig.log_in_page.log_in_password = my_password
# Click the Log In button
ig.log_in_page.log_in_button_click()
finally:
driver.quit()
Instabrade is page-aware. If you attempt to interact with a property or method for a page that isn’t currently loaded, a WrongPageError exception will get thrown:
In [1]: from selenium import webdriver
In [2]: from instabrade import Instagram
In [3]: driver = webdriver.Chrome()
In [4]: ig = Instagram(driver)
In [5]: ig.log_in_page.log_in_link_click()
In [6]: ig.log_in_page.log_in_username = my_username
In [7]: ig.log_in_page.log_in_password = my_password
In [8]: ig.log_in_page.log_in_button_click()
In [9]: ig.log_in_page.log_in_username = my_username
---------------------------------------------------------------------------
WrongPageError Traceback (most recent call last)
<ipython-input-9-eb1e96eabcf5> in <module>()
----> 1 ig.log_in_page.log_in_username = my_username
/Users/levi/workspace/instabrade/instabrade/decorators.py in inner(obj, *args, **kwargs)
7 @wraps(func)
8 def inner(obj, *args, **kwargs):
----> 9 obj.assert_on_page()
10
11 return func(obj, *args, **kwargs)
/Users/levi/workspace/instabrade/instabrade/base.py in assert_on_page(self)
64 exc_msg = "Wrong page loaded. Expected {0} but found {1}"
65 raise WrongPageError(exc_msg.format(self.PAGE_IDENTIFIER,
---> 66 current_page_identifier))
67
68 @property
WrongPageError: Wrong page loaded. Expected
PageID(name='Log In Page Identifier', css_path='h1.coreSpriteLoggedOutWordmark', attr='class', attr_value='coreSpriteLoggedOutWordmark')
but found
PageID(name='Home Page Identifier', css_path='main[role="main"] > section a[href$="explore/"]', attr='href', attr_value='/explore/')
In [10]:
Metadata
Release files for instabrade 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| instabrade-0.0.7.tar.gz | 12.8 kB | Without provenance | Details for instabrade-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| instabrade-0.0.7-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for instabrade-0.0.7-py2.py3-none-any.whl |
Total release size: 23.7 kB
Release files / instabrade-0.0.7.tar.gz
| Download URL | instabrade-0.0.7.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6ccb936242c8510dd3f34f4080cae14f21ded409e6f448510fbf3e69999991b
|
|
BLAKE2b-256 checksum How to use checksums |
e6de965721616d2c794f8659e98477330b9522c9c75e1fed6d1531e42904b187
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / instabrade-0.0.7-py2.py3-none-any.whl
| Download URL | instabrade-0.0.7-py2.py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7b313e99d85649e4376ffbd5adc3227978e8cf0c4231a8990bdb4ca69fe8e59f
|
|
BLAKE2b-256 checksum How to use checksums |
41e18a71939d16b428127ad755c6048cbeb20158790b6b410f78eaa3ce543eb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for instabrade 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.