2016024291-

粗糙实例:

全代码:

即:

    import requests

    url="https://item.jd.com/10818358039.html"

  try:

    r=requests.get(url)
    r.raise_for_status()//如果 r.status_code不是200,报错
    r.encoding=r.apparent_encoding
    print(r.text[:1000])
 except:
    print("爬取失败!")

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-12
  • 2021-12-05
猜你喜欢
  • 2021-08-28
  • 2021-11-30
  • 2021-10-16
  • 2021-11-17
  • 2022-01-03
  • 2022-01-07
  • 2021-10-03
相关资源
相似解决方案