如何通过Selenium Python从javascript网页中抓取特定信息?

时间:2019-07-18 09:02:36

标签: python selenium-webdriver

我相信,我无法从javascript网页上抓取“解决方案”字段。 网页地址: https://support.na.sage.com/selfservice/viewdocument.do?noCount=true&externalId=60390&sliceId=1&noCount=true&isLoadPublishedVer=&docType=kc&docTypeID=DT_Article&stateId=4183&cmd=displayKC&dialogID=197243&ViewedDocsListHelper=com.kanisa.apps.common.BaseViewedDocsListHelperImpl&openedFromSearchResults=true 我需要提取说明,原因和解决方案。

尝试了多种获取元素的方法,包括:

  • find_element_by_xpath
  • find_element_by_id
  • find_element_by_class_name。

没有得到期望的结果。 你能指导我以哪种方式工作?

1 个答案:

答案 0 :(得分:1)

https://support.na.sage.com/selfservice/viewContent.do?externalId=60390&sliceId=1 这是您可以抓取html的正确URL,请使用浏览器devtool的“网络”选项卡找到它。 Chrome范例 enter image description here