Comments (8)
What do you know, reboot fixed it.
from instascrape.
lol when in doubt, reboot! Awesome, thanks for update 😎
from instascrape.
Hello! I'm not able to reproduce this error, were you able to use the library at all prior to this or did this occur as soon as you started?
from instascrape.
Strange! It occurred as soon as I started.
from instascrape.
Does printing google.html
give you anything? If so can you post the result here?
I had this exact same problem about a week ago because Instagram started hitting me with 429 HTTP status codes on every single request, I ended up fixing it by passing in a proper default User-Agent in the request header but it seems like you might be getting the same problem
from instascrape.
Also tested on Python 3.9.1 on Debian Buster using Docker:
emil@MatebookD:~$ docker run -it python:3.9.1-buster bash
Unable to find image 'python:3.9.1-buster' locally
3.9.1-buster: Pulling from library/python
6c33745f49b4: Pull complete
c87cd3c61e27: Pull complete
05a3c799ec37: Pull complete
a61c38f966ac: Pull complete
c2dd6d195b68: Pull complete
29b9446ae7bd: Pull complete
09cf96c794f9: Pull complete
f674fd97fba7: Pull complete
9c7f9d05b1c1: Pull complete
Digest: sha256:341cf29e353c5ae49f1972e6472cbd0cd5ed3b2984c5c353167d331eca679827
Status: Downloaded newer image for python:3.9.1-buster
root@0faaafa4a2ed:/# pip3 install insta-scrape
Collecting insta-scrape
Downloading insta_scrape-1.6.1-py3-none-any.whl (26 kB)
Collecting beautifulsoup4
Downloading beautifulsoup4-4.9.3-py3-none-any.whl (115 kB)
|████████████████████████████████| 115 kB 2.6 MB/s
Collecting soupsieve>1.2
Downloading soupsieve-2.1-py3-none-any.whl (32 kB)
Collecting requests
Downloading requests-2.25.1-py2.py3-none-any.whl (61 kB)
|████████████████████████████████| 61 kB 1.3 MB/s
Collecting certifi>=2017.4.17
Downloading certifi-2020.12.5-py2.py3-none-any.whl (147 kB)
|████████████████████████████████| 147 kB 2.9 MB/s
Collecting chardet<5,>=3.0.2
Downloading chardet-4.0.0-py2.py3-none-any.whl (178 kB)
|████████████████████████████████| 178 kB 4.2 MB/s
Collecting idna<3,>=2.5
Downloading idna-2.10-py2.py3-none-any.whl (58 kB)
|████████████████████████████████| 58 kB 1.8 MB/s
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.2-py2.py3-none-any.whl (136 kB)
|████████████████████████████████| 136 kB 3.9 MB/s
Installing collected packages: urllib3, soupsieve, idna, chardet, certifi, requests, beautifulsoup4, insta-scrape
Successfully installed beautifulsoup4-4.9.3 certifi-2020.12.5 chardet-4.0.0 idna-2.10 insta-scrape-1.6.1 requests-2.25.1 soupsieve-2.1 urllib3-1.26.2
root@0faaafa4a2ed:/# python3
Python 3.9.1 (default, Dec 12 2020, 13:15:12)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from instascrape import *
>>> google = Profile('https://www.instagram.com/google/')
>>> google.scrape()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.9/site-packages/instascrape/core/_static_scraper.py", line 110, in scrape
self.json_dict = self._get_json_from_source(self.source, headers=headers)
File "/usr/local/lib/python3.9/site-packages/instascrape/core/_static_scraper.py", line 206, in _get_json_from_source
json_dict_str = self._json_str_from_soup(self.soup)
File "/usr/local/lib/python3.9/site-packages/instascrape/core/_static_scraper.py", line 237, in _json_str_from_soup
json_script = [str(script) for script in soup.find_all("script") if "config" in str(script)][0]
IndexError: list index out of range
from instascrape.
>>> google.html
'Oops, an error occurred.\n'
from instascrape.
Hmmm I've never seen that before and I've seen quite a lot of Instagram errors
okay last two questions lol, can you try requests.get('https://www.instagram.com/google/')
and print the result? Also are you able to login normally in your browser to Instagram?
from instascrape.
Related Issues (20)
- instascrape.exceptions.exceptions.InstagramLoginRedirectError: Instagram is redirecting you to the login page instead of the page you are trying to scrape. This could be occuring because you made too many requests too quickly or are not logged into Instagram on your machine. Try passing a valid session ID to the scrape method as a cookie to bypass the login requirement HOT 2
- Even after passing a valid cookie, the Instagram account gets disabled (update: permanently) HOT 2
- no of profiles during a day HOT 1
- Cannot retreive video_url from post object HOT 1
- Unable to locate file with data dump from posts
- TypeError: 'NoneType' object is not subscriptable on location scrape
- Biography field brings own bio
- Error : 'Post' object has no attribute 'video_url' HOT 1
- requests lib throwing `Invalid value NaN (not a number)` Error HOT 1
- ValueError while Scrapping Posts HOT 9
- KeyError: 'ProfilePage'
- Getting an Error while I call method "scrape" HOT 2
- ValueError: Invalid value NaN (not a number)
- JSONDecodeError within scrape() method HOT 6
- I want to grab the recent reels video views from the profile page (username/reels/)? Is that possible?
- TypeError:Profile.__init__() missing 1 required positional argument: data
- json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) HOT 3
- Error scraping photos: ModuleNotFoundError: No module named 'helpers' HOT 2
- its gives an error when i try to download the reel HOT 1
- MissingCookiesWarning: Request header does not contain cookies! It's recommended you pass at least a valid sessionid otherwise Instagram will likely redirect you to their login page.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from instascrape.