【发布时间】:2014-09-29 13:49:16
【问题描述】:
我有 THIST 页面,其中包含一些 javascript。您可以通过单击show details 来查看它们。
那么我怎样才能从那个 url 源中提取这些数据呢?
使用re?我在 re 中尝试的是:
import urllib
import re
gdoc = urllib.urlopen('ThatURL').read()
scriptlis = re.findall('(?si)<script>(.*?)</script>', gdoc)
print scriptlis
但没有回应...
使用硒? 这种情况下怎么办?
import lxml
out=lxml.html.tostring(lxml.html.parse('ThatURL'))
.
.
.
?
【问题讨论】:
标签: javascript python html selenium xpath