【问题标题】:What will be the Python Code for scraping a aspx page?用于抓取 aspx 页面的 Python 代码是什么?
【发布时间】:2020-03-17 22:46:19
【问题描述】:

我的要求是将 mcode 传递给下面的 web aspx 查询,然后将生成的网页打印为 pdf。

https://wwww.abcd.com/xyz/subject.aspx?mcode=99999

在上面的url中,唯一的变量是99999。所以我的目标是每次传递mcode,然后将生成的aspx页面打印为pdf。 请原谅我的简化语言,因为我是新手。

【问题讨论】:

    标签: asp.net python-3.x web-scraping beautifulsoup scrapy


    【解决方案1】:
    1. 使用urllib 获取类似here 的页面,使用您发布的网址。
    2. 使用https://weasyprint.org/将html打印成pdf
    3. 这与抓取无关。抓取是对网页内容进行解析和进一步处理的过程。如果需要,请搜索 beautifulsoup4 python 包

    【讨论】:

    • 非常感谢先生。我完全是新手。你能给我确切的 Python 代码吗?这将允许我通过 url 传递 mcode 并将生成的 asxp 页面打印为 pdf。
    • 如果您只想将网页打印为 pdf 安装 weazyprint 并按照here 所述执行以下命令:weasyprint https://wwww.abcd.com/xyz/subject.aspx?mcode=99999 yourpdf.pdf 您根本不需要任何编程。
    猜你喜欢
    • 2021-06-09
    • 1970-01-01
    • 2016-11-27
    • 2018-12-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-04
    • 1970-01-01
    相关资源
    最近更新 更多