【问题标题】:How to extract information that is not displayed when viewing page source in Google Chrome?如何提取在谷歌浏览器中查看页面源时未显示的信息?
【发布时间】:2019-06-19 02:37:20
【问题描述】:

我正在尝试从https://www.mathworks.com/help/ 抓取 Matlab 模块文档的链接。

我通常在谷歌浏览器中查看页面源代码以查看所需信息的模式。在这种情况下,我无法通过查看页面源来查看该信息。

如您所见,左侧框中有一个与项目对应的链接。我想提取该框中所有项目的名称及其对应的链接。

感谢您的帮助!

【问题讨论】:

  • 请在此分享您的编码尝试。

标签: python-3.x web-scraping


【解决方案1】:

找到他们用于该部分的 json。这里是:


import requests

help_json = requests.get('https://www.mathworks.com/help/all_product_doc.json').json()

base_url = 'https://www.mathworks.com/help/'

for content in help_json:
    print(content['displayname'])
    print(base_url+content['helplocation']+'\n')

【讨论】:

    猜你喜欢
    • 2011-10-15
    • 1970-01-01
    • 1970-01-01
    • 2012-09-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-13
    相关资源
    最近更新 更多