Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: searching with mojo dom

by adambot (Acolyte)
on Mar 11, 2018 at 15:49 UTC ( [id://1210661]=note: print w/replies, xml ) Need Help??


in reply to Re: searching with mojo dom
in thread searching with mojo dom

the HTML i'm working with can be found here: https://weather.com/weather/today/l/20001:4:US

the full/unedited selector is:

#APP > div > div.today.section-local-suite.page > div.section-page-nam +e > div.hero.hero-background.layout-centered > div.hero-flex.styles-d +2KKDEYo__heroFlex__3UOm0 > div.region.region-hero-left > div > sectio +n > div.today_nowcard-sidecar.component.panel > table > tbody > tr:nt +h-child(1) > td > span
(the wind speed text)

Replies are listed 'Best First'.
Re^3: searching with mojo dom
by adambot (Acolyte) on Mar 11, 2018 at 20:42 UTC
    I'm thinking if i could figure out how to do a div find that would be easiest -- i have my @headers = $dom->find('div ~ today_nowcard-sidecar')->map('text')->each; but it doesn't seem to find anything...

      working more on this, Here is the search code that works:

      @data = $dom->find('div.today_nowcard-sidecar')->each;

      Now i'm left trying to dig through all the data -- when i go through the array i find that the info i need is represented in the dom identified by ${$VAR1}->{'tree'}->[4]->[5]->[4]->[5]->[4] (data gotten using Data::Dumper on @data). Any pointers?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-23 11:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found