python脚本卡住了。如何生成异常? 例如:代码中使用的url,我该如何处理这种情况。我也试过chromedriver。
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
url="http://collegeofdesign.info/?page_id=9"
caps = webdriver.DesiredCapabilities.PHANTOMJS
caps["phantomjs.page.settings.resourceTimeout"] = 10
caps["pageLoadStrategy"] = "none"
browser = webdriver.PhantomJS(desired_capabilities=caps,executable_path='/home/md/Downloads/phantomjs-2.1.1-linux-x86_64/bin/phantomjs',service_args=['--ignore-ssl-errors=true', '--ssl-protocol=any','--cookies-file=/tmp/tmpfile'])
browser.set_page_load_timeout(10)
browser.set_script_timeout(5)
browser.implicitly_wait(15)
browser.get(url) ## stuck here infinitely
browser.quit()