|
5鱼币
本帖最后由 python羊 于 2020-4-30 16:49 编辑
我想打印该网页颜色对应的 : G 。
为什么我用查找没有找到
我的原代码:
————————————————————————
import urllib.request
response = urllib.request.urlopen('http://www.checkgems.com/cn/cert/gia/7223671706').read()
response = response.decode('utf-8')
a=response.find("r __web-inspector-hide-shortcut__")
print(a)
——————————————————————————————
- import urllib.request
- import re
- response = urllib.request.urlopen('http://www.checkgems.com/cn/cert/gia/7223671706').read()
- response = response.decode('utf-8')
- a=re.findall('<td class="r "> (\w)</td>',response)
- print(a)
复制代码
。。。你爬网页要多学下数据提取
|
|