0

Python noobie here.

What I have is a data harvesting problem. I'm on this website, and when I inspect the element that I want with Firebug, it shows the source containing the information I need. However the regular source code (without Firebug) doesn't give me this info. This means I also can't get the data with the normal selenium HTML grabbing, either.

I'm wondering if there is a way that selenium can grab this data like Firebug does -- I'm guessing this is HTML that is generated after the page loads with javascript or jquery.

Here is a picture: https://i.stack.imgur.com/mIF5l.png

You can see that the info I want is 'greyed out', unlike most of the other HTML there. Maybe that is a good clue as to what kind of data that really is.

user1472747
  • 529
  • 3
  • 10
  • 25

1 Answers1

0

Try to use the following code and see if it works.

import selenium.webdriver.support.ui

element = WebDriverWait(driver, 10).until(
        lambda driver : driver.find_element_by_xpath("fImageMap > area:nth-child(2)")
)
Aaron Levenstein
  • 385
  • 2
  • 12
  • is that for python? it's telling me WebDriverWait isn't defined. I have 'import selenium' and 'from selenium import webdriver' – user1472747 Mar 25 '13 at 23:29
  • I think you should read the answer to the following question it might help you solve your problem. http://stackoverflow.com/questions/8917785/python-webdriver-wait – Aaron Levenstein Mar 26 '13 at 02:36
  • It says that webdriverwait is not defined, even with the import :( you're missing a double quote in your string arg, by the way – user1472747 Mar 29 '13 at 18:11
  • Sorry about that my experience with selenium testing is in Java rather than python. I will try to get it set up correctly in selenium some time this weekend and will post my code if I am successful. – Aaron Levenstein Mar 29 '13 at 18:48