close 和 quit 都只能在 get 完才能使用
from selenium import webdriver driver = webdriver.Chrome() driver.get('http://www.domain.com/play/145804.html') for i in driver.find_elements_by_id('jp_audio_0'): print("Value is: %s" % i.get_attribute("src")) driver.close() driver.quit()
1 stancaohua 2017-04-21 18:17:39 +08:00 |
![]() | 2 guokeke 2017-04-21 18:19:29 +08:00 @stancaohua 233 |
3 61882328 OP 谢谢。。我试下。 |
4 yezhiye 2017-04-21 22:12:43 +08:00 不尝试下无头浏览器吗…… |
5 wangxiaodong 2017-04-21 22:49:16 +08:00 Google 已推出了 Headless Chromium 模式 https://url.openle.com/go#url=https://ask.congci.com/-/content/chrome-liulanqi-ruhe-zuo-zidonghua-ceshi |
6 mingyun 2017-04-22 00:06:17 +08:00 @wangxiaodong nice |