www-mechanize

Scripts broke after upgrading LWP “certificate verify failed”

瘦欲@ 提交于 2019-12-01 02:25:18
I have a lot of scripts, most of them based around WWW::Mechanize that scrape data off of misc hardware that is accessible via HTTPs. After upgrading most of my perl installation and its modules, all scripts using HTTPS:// broke because of "certificate verify failed" This is a result of the fact that the newer versions of LWP does a proper check on the certificate and dies if something doesn't match. In my case, the failed certificate authentication is expected due to the circumstances, so i needed to find a way of cleanly circumventing this check. Say I want to tell you something, and I don't

Perl WWW::Mechanize (or LWP) get redirect url

百般思念 提交于 2019-11-29 06:52:52
So I am using WWW::Mechanize to crawl sites. It works great, except if I request a url such as: http://www.levi.com/ I am redirected to: http://us.levi.com/home/index.jsp And for my script I need to know that this redirect took place and what the url I was redirected to is. Is there anyway to detect this with WWW::Mechanize or LWP and then get the redirected url? Thanks! use strict; use warnings; use URI; use WWW::Mechanize; my $url = 'http://...'; my $mech = WWW::Mechanize->new(autocheck => 0); $mech->max_redirect(0); $mech->get($url); my $status = $mech->status(); if (($status >= 300) && (

Can't create an instance of WWW:Mechanize::Firefox

不羁岁月 提交于 2019-11-28 13:51:33
I've just installed WWW:Mechanize::Firefox , but when I tried to create an instance of this "class": my $mech = WWW::Mechanize::Firefox->new(); I get this error: Failed to connect to , problem connecting to "localhost", port 4242: No connection could be made because the target machine actively refused it. at C:/strawberry/perl/site/lib/MozRepl/Client.pm line 144 Can anyone help please? You must install mozrepl and start it in the menu Tools → MozRepl → Start . In addition to installing and starting firefox/mozrepl, an actively refused connection is frequently the work of a FIREWALL, so you

Perl WWW::Mechanize (or LWP) get redirect url

蹲街弑〆低调 提交于 2019-11-28 00:33:09
问题 So I am using WWW::Mechanize to crawl sites. It works great, except if I request a url such as: http://www.levi.com/ I am redirected to: http://us.levi.com/home/index.jsp And for my script I need to know that this redirect took place and what the url I was redirected to is. Is there anyway to detect this with WWW::Mechanize or LWP and then get the redirected url? Thanks! 回答1: use strict; use warnings; use URI; use WWW::Mechanize; my $url = 'http://...'; my $mech = WWW::Mechanize->new

Can't create an instance of WWW:Mechanize::Firefox

若如初见. 提交于 2019-11-27 08:00:53
问题 I've just installed WWW:Mechanize::Firefox, but when I tried to create an instance of this "class": my $mech = WWW::Mechanize::Firefox->new(); I get this error: Failed to connect to , problem connecting to "localhost", port 4242: No connection could be made because the target machine actively refused it. at C:/strawberry/perl/site/lib/MozRepl/Client.pm line 144 Can anyone help please? 回答1: You must install mozrepl and start it in the menu Tools → MozRepl → Start . 回答2: In addition to

Managing HTTP Cookies on iPhone

倾然丶 夕夏残阳落幕 提交于 2019-11-26 23:44:37
I want to port a python app that uses mechanize for the iPhone. This app needs to login to a webpage and using the site cookie to go to other pages on that site to get some data. With my python app I was using mechanize for automatic cookie management. Is there something similar for Objective C that is portable to the iPhone? Thanks for any help. Steve Madsen NSURLConnection gives you cookie management for free. From the URL Loading System Programming Guide : The URL loading system automatically sends any stored cookies appropriate for an NSURLRequest. unless the request specifies not to send

Is there a PHP equivalent of Perl's WWW::Mechanize?

痴心易碎 提交于 2019-11-26 12:22:24
I'm looking for a library that has functionality similar to Perl's WWW::Mechanize , but for PHP. Basically, it should allow me to submit HTTP GET and POST requests with a simple syntax, and then parse the resulting page and return in a simple format all forms and their fields, along with all links on the page. I know about CURL, but it's a little too barebones, and the syntax is pretty ugly (tons of curl_foo($curl_handle, ...) statements Clarification: I want something more high-level than the answers so far. For example, in Perl, you could do something like: # navigate to the main page $mech-

Managing HTTP Cookies on iPhone

自古美人都是妖i 提交于 2019-11-26 09:15:53
问题 I want to port a python app that uses mechanize for the iPhone. This app needs to login to a webpage and using the site cookie to go to other pages on that site to get some data. With my python app I was using mechanize for automatic cookie management. Is there something similar for Objective C that is portable to the iPhone? Thanks for any help. 回答1: NSURLConnection gives you cookie management for free. From the URL Loading System Programming Guide: The URL loading system automatically sends