如何用python查看网页代码

用python查看网页代码的方法:
1、使用“import”导入requests包
import requests
2、使用requests包的get()函数通过网页链接获取网页的源码,然后使用print()语句输出就可以了

执行结果如下:

更多Python知识,请关注:云海天python教程网!!
来源:PY学习网:原文地址:https://www.py.cn/article.html

用python查看网页代码的方法:
1、使用“import”导入requests包
import requests
2、使用requests包的get()函数通过网页链接获取网页的源码,然后使用print()语句输出就可以了

执行结果如下:

更多Python知识,请关注:云海天python教程网!!
来源:PY学习网:原文地址:https://www.py.cn/article.html