Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re:LWP::UserAgent & match

by marto (Cardinal)
on May 21, 2020 at 17:23 UTC ( #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
Node Status?
node history
Node Type: note [id://11117062]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2020-11-24 12:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?