我如何在Json有效负载请求中调用另一个模块

问题描述

我仍然是Python的新手,我的目标是从市场获取交易数据作为我的论文数据。 https://www.tokopedia.com/wangilestari/milk-jug-latina-frother-paket-duo-hitam?whid=0

我想获取以下数据:

enter image description here

我已经使用过多个lib,例如beautifulsoup或selenium。但无法正常工作。所以现在我使用Json有效负载请求来获取数据。但是在最近的试用中,我仅将Json有效负载用于Review Data,这是代码

list_review = [] 
for x in range(2): 
    payload = [{ 
        "operationName": "PDPReviewListQuery","variables": { 
        "page": x,"rating": 0,"withAttachment": 0,"productID": 85252468,"perPage": 10 
        },"query": "query PDPReviewListQuery($productID: Int!,$page: Int!,$perPage: Int!,$rating: Int!,$withAttachment: Int!) {\n  ProductReviewListQuery(productId: $productID,page: $page,perPage: $perPage,rating: $rating,withAttachment: $withAttachment) {\n  list {\n      reviewId\n      message\n     }\n  }\n}\n"  
    }] 
    res = requests.post("https://gql.tokopedia.com/",json = payload) 

使用此代码,我可以获得所有评论数据。但是我需要更多的领域,尤其是在交易模块中。 当我寻找html树时,交易数据(产品名称,价格,num_transaction )在PDPinformationContainer模块中。

enter image description here

那么,是否有任何解决方案或建议来调用该模块?非常感谢能够帮助我从论文数据中获取信息的每个人:)。谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)