鱼C论坛

 找回密码
 立即注册
查看: 1104|回复: 1

请问该网页怎么提取相应的数据

[复制链接]
发表于 2020-9-15 23:40:49 | 显示全部楼层 |阅读模式
10鱼币
本帖最后由 python羊 于 2020-9-16 09:31 编辑

想要提取网页中 “净度”对应的 “VS1”,可是一直找到的是空值。

网站:https://www.gia.edu/report-check?reportno=6352100549
代码:
————————————————————
from urllib.request import Request,urlopen
import re
number = '6352100549'
url = 'https://www.gia.edu/report-check?reportno='+ number
headers = {
    'User-Agent':'Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1500.55 Safari/537.36'
}

request = Request(url,headers=headers)
response = urlopen(request).read()
response = response.decode('utf-8')

clarity = re.findall('<strong class="dynamic" id="CLARITY_GRADE">(.+)</strong>',response)

print(response)
print(clarity)

——————————————————————————————————————————

Inkedgia图片_LI_Moment.jpg
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2020-9-16 09:28:45 | 显示全部楼层
https://fishc.com.cn/forum.php?m ... peid%26typeid%3D392
你这是开了两个相同的帖子?
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-23 21:28

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表