in reply to Re: using HTML::TreeBuilder effectively
in thread using HTML::TreeBuilder effectively
I have to admit that I'm curious how you think I should have typed the subject for this thread. It also seems to be the case that the script in the original post has outlived its assumptions for how it gives useful output. It has interesting syntax, and I'd like to be able to say that I had that part mastered by now, but I do not.
My Q2 may have been pinned on that script, but I'd prefer not to speak about it again until we obtain output as described in the subject of the original post.
How does one make yahoo able to find its own news?
C:\cygwin64\home\Fred\pages2\hunt>perl lib6.pl GET https://search.yahoo.com/search [s] p= (text) <NONAME>=Search (submit) fr=sfp (hidden readonly) fr2= (hidden readonly) iscqry= (hidden readonly) search string is Yahoo News C:\cygwin64\home\Fred\pages2\hunt>type lib6.pl #! /usr/bin/perl use warnings; use strict; use 5.01; # create a new browser use WWW::Mechanize; my $browser = WWW::Mechanize->new(); # tell it to get the main page $browser->get('https://search.yahoo.com/'); # make sure $link is defined if ( defined $browser ) { $browser->dump_forms; my $brand = 'Yahoo'; my $collection = 'News'; my $search_string = "$brand $collection"; say "search string is $search_string"; my $url = $browser->uri; system( 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe +', $url ); } else { use 5.01; $browser->back; say "tja"; my $url = $browser->uri; system( 'C:\Program Files (x86)\Google\Chrome\Application\chrome.exe +', $url ); }
Where I'd rather focus is on a generic way to specify searches, which are the trade of the website we're talking to. They announce themselves as 'Search' in this example, but I would not want to be wed to the notion that it had to be upper case, for example. Here is where I think the output is useful:
<NONAME>=Search (submit)So I would like to populate the search string, submit, and then follow the first link suggested.
Thank you for your comment,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: using HTML::TreeBuilder effectively
by poj (Abbot) on Sep 17, 2015 at 07:33 UTC | |
|
Re^3: using HTML::TreeBuilder effectively
by Anonymous Monk on Sep 17, 2015 at 07:54 UTC |