Comments (7)
I do not think one can bypass the 2 factor authentication. What we can do is that use email as 2-factor authentication and then add a simple code to extract code from email and then login for first time (we do not need to worry for next login). From this https://github.com/timgrossmann/InstaPy/blob/master/instapy/login_util.py
you can see that they have made bypass_suspicious_login
method to do so. It can be used as reference to do so.
from instascrape.
Hey @chris-greening, have you seen this approach? It had some recent updates. Perhaps is a good way of avoiding selenium and heavier tools.
from instascrape.
Hey @chris-greening, have you seen this approach? It had some recent updates. Perhaps is a good way of avoiding selenium and heavier tools.
That's exactly the idea I was going for! Definitely looking to use
requests.post
if it's possible. I'll tinker around with this later today, thanks for the reference 😏
Awesome, when you start coding this, tag me for help. I would love to help you w this. 😄
from instascrape.
@MNISAR, thanks for the info! Funny that you mention bypass_suspicious_login
, I was literally just looking at instapy's login_util.py
like two days ago for inspiration.
I'm apprehensive of using selenium
for this project because I want to avoid the overhead of opening any browsers or needing any drivers. The original inspiration for this project was actually so that it could run automated on a remote server and not have to worry about hacking together some sort of virtual display or something to get selenium
working.
I've caught wind that you might be able to POST request your way through though as recently as 2 months ago with requests
(see here) but wasn't able to find success in the twenty minutes I spent tinkering with it lol but a lightweight solution or similar is definitely the preferred way of getting in if possible
Regarding the 2-factor authentication though, I figure that's a bridge we can cross when we get to it. I'm pretty sure Insta has 2-factor turned off by default and I just want to get in under normal circumstances
from instascrape.
Good to hear that my comment was helpful!
Hey also did you check the headless mode in selenium, check this link it says about the benefits of using headless mode in tools such as selenium. (reduces overhead)
One more thing about "remembering login" is using --user-data-dir=chrome-data
in selenium. It works as if a user is using the chrome and you do not have to login every time. This might reduces suspicious login attempts.
from instascrape.
@MNISAR definitely a solid suggestion, instascrape is a bare bones adaptation of a dynamic scraper I wrote that was Selenium heavy for scraping dynamically rendered Instagram content; it isn't that much of a leap to integrate some optional PhantomJS or headless Chrome action to do that dynamic stuff requests
just can't do
Certainly food for thought moving forward!
from instascrape.
Hey @chris-greening, have you seen this approach? It had some recent updates. Perhaps is a good way of avoiding selenium and heavier tools.
That's exactly the idea I was going for! Definitely looking to use requests.post
if it's possible. I'll tinker around with this later today, thanks for the reference 😏
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.