亚马逊-获取评论-买家信息-通过评论链接获取评论账号id和名字

driver = webdriver.Chrome()
driver.get("https://www.amazon.de/gp/customer-reviews/xxxxxxxxxxxxxxx/ref_=bcr_shw_rev_dtl")
time.sleep(1)
# comment_account_id and comment_account_name
# 通过评论链接获取评论账号id和名字
if com_amz_x.check_driver_is_exists_by_x_path(driver, "//div[@data-hook='genome-widget']") == 1:
gp_profile = com_amz_x.find_element(driver, "//div[@data-hook='genome-widget']")
a_link = com_amz_x.find_element(gp_profile, "//a[@class='a-profile']")
comment_account_id = com_amz_x.get_attribute(a_link, "href")
if comment_account_id is not None and comment_account_id != "":
comment_account_id = comment_account_id.split("gp/profile/")[1]
comment_account_id = comment_account_id.split("/")[0]
print(comment_account_id)
el_comment_account_name = com_amz_x.find_element(gp_profile, "//span[@class='a-profile-name']")
comment_account_name = com_amz_x.get_attribute(el_comment_account_name, "innerText")
comment_account_name.replace("'", "")
print(comment_account_name)
else:
print(000)

自动化获取数据,不需要登录买家账号。





posted @   liskov_design  阅读(5)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
历史上的今天:
2023-02-27 C# 扩展Dictionary的自动获取方法。
点击右上角即可分享
微信分享提示