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,


In reply to Re^2: using HTML::TreeBuilder effectively by Aldebaran
in thread using HTML::TreeBuilder effectively by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.