Perl-Sensitive Sunglasses | |
PerlMonks |
Cookies, JavaScript and User Agent Problemsby koolgirl (Hermit) |
on Oct 25, 2011 at 00:28 UTC ( [id://933506]=perlquestion: print w/replies, xml ) | Need Help?? |
koolgirl has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
OK, I am using a web scraper, to loop through several pages of about 20 or so different links to individual records. I have three phases, get the pages - separate the individual records, strip those records. All was going rather nicely, until I hit these darn sites with javascript, and I'm thinking the problem (from what research I've done?) is the cookies - not really the javascript, so this is my scraper here:
The two cookie jar lines are what I've been playing around with, not sure if they should be in or out of my loop, so one is commented out - also, I tried these two different methods, an empty jar, then the %ENV version. (I also have tried to use HTTP::Request because I was researching about using the two together( which that didn't seem to help ) and have tried every combination I can think of or find). Now - what happens with these sites, is that I pass it the query string, with the search results (the page number looped - which has been working fine thus far), as you can see above, but it keeps giving me the log-in page over and over. I've been doing a lot research and reading, and I think this is a cookie problem. I have read the docs on all the modules I'm using, and I really need to find something that works with one of these modules, as I'm having issues with installation right now, another topic, but that is why I haven't tried WWW::Mechanize. I have tried a lot of different combinations, but I keep coming back to these two lines of code I'm trying above with the cookie jars, because based on all I've read, they should work? Please...a little help....thanks koolgirl
Back to
Seekers of Perl Wisdom
|
|