0

So I'm making this scraper program but I would need to catch information that doesn't show up in the source code.

Here is what it looks like in the source :

<td><script> <type="text/javascript">SCRIPT("SUPERLONGVARIABLE")</script></td>

And I'd like to be able to catch the result (which is just a short string of about 5 - 20 letters).

Any idea how I could do that? Not sure if the requests module can help me on this one.

Thanks in advance guys! :)

bastelflp
  • 7,944
  • 5
  • 30
  • 65
taze totero
  • 169
  • 1
  • 1
  • 7

1 Answers1

1

Basically, you'd want to learn how to use selenium for python : link.
By utilizing driver.execute_script('foo'), you can actually get the result of that execution.

For simliar answer, look at this question on so

Community
  • 1
  • 1
taesu
  • 4,398
  • 3
  • 22
  • 41
  • My bad I thought I had answered, I tried with the command I wrote on the last comment but the thing is it litterally goes through firefox (as in the firefox page pops up) and I don't end up getting the result I want in python (meaning the decoded string) – taze totero Sep 17 '15 at 18:36