I'm failing miserably. I want to parse the following URL:
http://finance.yahoo.com/quote/MSFT?ltr=1
And capture these three sections: * All * News * Press Releases
Here's what I've come up with..
#!/bin/perl
use Mojo::UserAgent;
use strict;
use warnings;
use feature 'say';
my $ua_string = "Mozila .. ";
my $url = "http://finance.yahoo.com/quote/MSFT?p=MSFT";
my $timeout = "5";
my $ua = Mojo::UserAgent->new( max_redirects => 5, timeout => $timeout );
$ua->transactor->name($ua_string);
my $content = $ua->get($url)->res->dom->at('#436')->{value};
say $content;
Any help would be appreciated.. Thanks
The way you access the DOM is not correct.
An example to parse parts of the news section would be: