Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re:LWP::UserAgent & match

by marto (Cardinal)
on May 21, 2020 at 17:23 UTC ( [id://11117062]=note: print w/replies, xml ) Need Help??


in reply to LWP::UserAgent & match

Enjoy making life difficult for yourself huh? We've been here before.

#!/usr/bin/perl use strict; use warnings; use Mojo::UserAgent; use feature 'say'; my $url = 'https://finance.yahoo.com/quote/AAPL?p=AAPL&.tsrc=fin-srch' +; my $ua = Mojo::UserAgent->new; say $ua->get( $url )->res->dom->at('span.[class^=Trsdu]')->attr->{'dat +a-reactid'};

Output:

31

Down since last month I see. The lesson is to learn from previous working solutions you've been given.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11117062]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-20 04:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found