I am using $ua to grab some HTML from my $url = "http://finance.yahoo.com/quote/MSFT?p=MSFT";
I am able to grab the HTML content from the URL just fine. Then I am using Mojo::DOM to sub parse, that is the correct step, right? I want to further strip the A HREF from the Mojo $url get() html content...This is what I have:
my $ua = Mojo::UserAgent->new( max_redirects => 5, timeout => $timeout );
my $dom = Mojo::DOM->new;
my $content = $ua->get($url)->res->dom->at('div#quoteNewsStream-0-Stream')->content;
my $content2 = $content->$dom->find('a href#');
Just use the Mojo::DOM that is returned by Mojo::UserAgent:
Outputs:
For an 8 minute tutorial on using these tools, check out Mojocast Episode 5