2👍
✅
Something else to remember: You need to maintain a browser session with the remote site so that site knows which CAPTCHA you’re trying to solve. Lots of webclients allow you to store your cookies and I’d suggest you dump them in the Django Session of the user you’re doing the screen scraping for. Then load them back up when you submit the CAPTCHA.
Here’s how I see the full turn of events:
- User places search request
- Query remote site
- If not CAPTCHA,
GOTO #10
- Save remote cookies in local session
- Download image captcha (perhaps to session too?)
- Present CAPTCHA to your user and a form
- User Submits CAPTCHA
- You load up cookies from #4 and submit the form as a POST
GOTO #3
- Process the data off the page, present to user, high-five yourself.
👤Oli
0👍
request.session['name'] = variable
will store it
then,
variable = request.session['name']
will retrieve it.
Remember though, its not a database, just a simple session store and shouldn’t be relied on for anything critical
- [Answered ]-Why do I get an InvalidDocument exception when saving an object into MongoDB in Django for the first time?
- [Answered ]-Rest framework how to create optional nested object?
- [Answered ]-Django Does Not Write Logs to File
- [Answered ]-Objects to support the front page of my Django powered web site?
Source:stackexchange.com