Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/314.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PhantomJS Python挂起? 在我的脚本中,由于某种原因,幻像只是悬挂: Phantomjs版本=1.9.8 [信息-2015-10-08T16:34:08.473Z]会话管理器RQHAND-"发布新闻会话命令-创建新会话:65e82940-6dda-11e5-8a19-53533527191c,依此类推_Python_Selenium_Phantomjs - Fatal编程技术网

PhantomJS Python挂起? 在我的脚本中,由于某种原因,幻像只是悬挂: Phantomjs版本=1.9.8 [信息-2015-10-08T16:34:08.473Z]会话管理器RQHAND-"发布新闻会话命令-创建新会话:65e82940-6dda-11e5-8a19-53533527191c,依此类推

PhantomJS Python挂起? 在我的脚本中,由于某种原因,幻像只是悬挂: Phantomjs版本=1.9.8 [信息-2015-10-08T16:34:08.473Z]会话管理器RQHAND-"发布新闻会话命令-创建新会话:65e82940-6dda-11e5-8a19-53533527191c,依此类推,python,selenium,phantomjs,Python,Selenium,Phantomjs,原因是什么?最好的解决方案是什么?还有人能解释一下使用隐式/显式等待是否能解决这个问题吗?我在读有关它的书,但似乎不理解这个概念。在此代码块中的某个位置: 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()[-

原因是什么?最好的解决方案是什么?还有人能解释一下使用隐式/显式等待是否能解决这个问题吗?我在读有关它的书,但似乎不理解这个概念。在此代码块中的某个位置:

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)
在抓取元素之后,它就挂起了?

您说“在我的脚本中间,PhantomJS只是挂起了”,但这在您的代码中到底在哪里?没有足够的信息来诊断您的问题。您说“在我的脚本中间,PhantomJS刚刚挂起”,但这在您的代码中到底在哪里?没有足够的信息来诊断您的问题。