简体   繁体   中英

Use browser authenticated credentials to scrape data from user account using python mechanize

I have build a web scraper for amazon user accounts using python with mechanize, beautifulsoup modules. The idea was to login via mechanize and parse the webpage using beautifulsoup which works successful for my account. i want to open this program as a web application and allow others to login using their amazon account and get useful information about their account.

The problem i have is that no one will trust my web application enough to provide their amazon credentials directly. Amazon doesnt provide(or atleast i couldnt find it) any other means to authenticate users. so I was wondering if their are other ways to let users authenticate via my web app. The things i thought are as follows 1) Allow users to login via browser(chrome,firefox) and fetch the cookie which can then be used by my webapp. 2) use mechanize to get credentials and then pass it over my webapp

I have no clue how both of them can be accomplished using python. Anyone has a rough idea how to do it. I have already tried using pycookiecheat module for chrome which doesnt work for all OSes. any other brainstorming ideas much appreciated?

Unfortunately it looks like Amazon has taken some measures to prevent automated login - at least all my mechanize scripts (both python and perl) are no longer working.

Therefore from my point of view the best approach is to let the user login and store credentials locally on their devices.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM