出于某种原因,在我的脚本中间,PhantomJS只是挂起了:
Phantomjs版本=1.9.8
[INFO-2015-10-08T16:34:08.473Z]SessionManagerReqHand-_postNewSessionCommand-新建会话:65e82940-6dda-11e5-8a19-53533527191c,依此类推。。。。在
原因是什么?最好的解决办法是什么?还有人能解释一下使用隐式/显式等待是否可以解决这个问题吗?我在读这篇文章,似乎不明白这个概念。在这个代码块的某个地方:tree = etree.HTML(driver.page_source)
time.sleep(3)
nhsfield1 = tree.xpath('//h1//text()')[0].strip().split()[-3] + " " + tree.xpath('//h1//text()')[0].strip().split()[-2]
time.sleep(3)
print "Scraping elements Scout"
try:
print "Field2"
nhsfield2 = tree.xpath('//div[@class="breadcrumbs"]//text()')[-1].strip() [1:].strip()
except Exception as e:
print "error nhsfield2"
nhsfield2 = ""
print e
print "Field3"
nhsfield3 = tree.xpath('//h1//text()')[0].strip().split(":")[-1].strip()
driver.find_element_by_id("ui-id-3").click()
time.sleep(2)
就在刮了元素侦察机之后就挂了?在