c 抓取网页数据(我想从这里摘取新闻头条程序开始执行,但是没有提取新闻标题,程序结束 )
优采云 发布时间: 2022-04-19 16:06c 抓取网页数据(我想从这里摘取新闻头条程序开始执行,但是没有提取新闻标题,程序结束
)
我想从这里提取新闻标题。程序开始执行,但没有提取新闻标题,程序结束。这是我从 网站
获取新闻 URL 标题的函数
def dvm():
print('--dvm news 360--')
url = 'https://www.dvm360.com/news'
browser.get(url)
time.sleep(20)
headlines = browser.find_elements_by_class_name('title')
url_headlines = [ele.find_element_by_tag_name('a').get_attribute('href') for ele in headlines]
print(url_headlines)
browser.close()
browser.quit()
这是它在我的终端上打印的内容
--dvm news 360--
[15036:4376:0930/121207.716:ERROR:chrome_browser_main_extra_parts_metrics.cc(228)] crbug.com/1216328: Checking Bluetooth availability started. Please report if there is no report that thi
s ends.
[15036:7848:0930/121207.719:ERROR:device_event_log_impl.cc(214)] [12:12:07.719] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to the
system is not functioning. (0x1F)
[15036:4376:0930/121207.720:ERROR:chrome_browser_main_extra_parts_metrics.cc(231)] crbug.com/1216328: Checking Bluetooth availability ended.
[15036:4376:0930/121208.338:ERROR:chrome_browser_main_extra_parts_metrics.cc(234)] crbug.com/1216328: Checking default browser status started. Please report if there is no report that thi
s ends.
[15036:4376:0930/121209.747:ERROR:chrome_browser_main_extra_parts_metrics.cc(238)] crbug.com/1216328: Checking default browser status ended.
[]
这里有什么问题?请帮我理解。谢谢
编辑:使用@cruisepandey 的答案后得到的输出如下
--dvm news 360--
[13608:1192:0930/141223.693:ERROR:chrome_browser_main_extra_parts_metrics.cc(228)] crbug.com/1216328: Checking Bluetooth availability started. Please report if there is no report that thi
s ends.
[13608:1192:0930/141223.694:ERROR:chrome_browser_main_extra_parts_metrics.cc(231)] crbug.com/1216328: Checking Bluetooth availability ended.
[13608:1192:0930/141223.695:ERROR:chrome_browser_main_extra_parts_metrics.cc(234)] crbug.com/1216328: Checking default browser status started. Please report if there is no report that thi
s ends.
[13608:12140:0930/141223.700:ERROR:device_event_log_impl.cc(214)] [14:12:23.700] USB: usb_device_handle_win.cc:1048 Failed to read descriptor from node connection: A device attached to th
e system is not functioning. (0x1F)
[13608:1192:0930/141223.827:ERROR:chrome_browser_main_extra_parts_metrics.cc(238)] crbug.com/1216328: Checking default browser status ended.
Morris Animal Foundation announces new equine and animal welfare advisory members
Understanding Cushing syndrome and cortisol: From lab work to rechecks
A call for change: Addressing the lack of diversity in veterinary schools and beyond
Butterfly Network and AVG collaborate to provide breakthrough ultrasound to UrgentVet clinics
3 Methods for battling burnout in veterinary medicine
Dechra acquires veterinary marketing and distributions rights for Equine ProVet APC
something went wrong