Lesson 4 Practice 2 Scraping Data

In Lesson 4 Practice 2 everything works except that I cannot pull temperature data for any city other than New York. I’ve looked at posts from others who have had a similar issue and none of the solutions discussed seem to work. Additionally the solution I downloaded after the walk through fails for the same reason as well. It seems to me that it likely comes down to the selector.

Currently I have the following attributes (I put a space after < just because otherwise it wasn’t appearing in this post):

< html url= ‘www.google.com’/>
< webctrl id=‘wob_tm’ tag=‘SPAN’ />

How can I correct this bot to ensure it pulls temperature from different cities?

Hi,
Try to use Variable to store city name. And assign the variable in Message box to show.

Can you check the selector of all cities using uiexplorer? There must be change in some properties. According to that you can make your selector dynamic. the

@BAmdahl The issue is this part of your selector:

< html url= ‘ www.google.com />

You need to adjust it to capture the information on the search result page as currently you’re telling it to take the information only from the www.google.com home page. Since all the activities you’re using (besides the input dialog activity) are being performed in the browser, you should put them in an “Attach Browser” activity scope like so:

When this is done, selectors inside the attach browser container now inherit the “parent” selector, which results in the Get Text activity for temperature only needing the relative selector you have: < webctrl id=‘wob_tm’ tag=‘SPAN’ />

@Divyashreem - His relative selector for the temperature (the Span & ID tag) is correct as I used the same one back when I went through this example. I loaded my workflow and confirmed this just now:

selector

The answer also does work, Google has not changed their selectors on this page like they did for the stock practice example.

Thank you! Once I put in an “Attach Browser” activity it worked perfectly.

2 Likes

Glad to here you were able to resolve it!