Use cookies from a script in a browser
gervaz
gervaz at gmail.com
Fri Mar 18 18:23:23 EDT 2011
On 18 Mar, 22:52, Miki Tebeka <miki.teb... at gmail.com> wrote:
> You can use mechanize, which holds a cookie jar and can user the browser cookies as well.
I use:
opener =
urllib.request.build_opener(urllib.request.HTTPCookieProcessor())
urllib.request.install_opener(opener)
I start scraping from http://page.com/home.html that need the cookies
enabled, then, once I found what I was looking for, I've got
http://page.com/pageX.html and http://page.com/pageY.html. Those page
cannot be viewed if I just copy & paste the url in the browser,
because they need the cookies.
What can I do?
Thanks,
Mattia
More information about the Python-list
mailing list