首页 > 解决方案 > 试图抓取“hellopeter.com”无法深入了解实际评论

问题描述

我正在尝试制作一个自动化系统,该系统将建立一个来自 hellopeter 的公司的评论数据库。

我想在这个数据集上应用情感分析,我试过用漂亮的汤,但我无法挖掘重要信息

page = requests.get('https://www.hellopeter.com/telkom/reviews/appalling-service-cdc4559e8084e0db01dd6d7e807875460607ac77-2851593')
soup = BeautifulSoup(page.content, 'html.parser')

print(soup.prettify())

我期望的输出是能够深入到实际审查数据所在的类。我实际上得到的是

下面大约有10层

<div id="app">
  </div>

它输出,我不知道如何进行实际审查

更具体地说,我想要

<p data-v-403b1c0a="" itemprop="reviewRating" itemscope="itemscope" itemtype="http://schema.org/Rating">

1

<p data-v-403b1c0a="" itemprop="reviewBody" class="full-content">

<p data-v-403b1c0a="" itemprop="name" class="is-detail-card">APPALLING SERVICE</p>

元素任何建议

标签: python-3.xseleniumxpathbeautifulsoupwebdriverwait

解决方案


如果您转到网络选项卡,您将获得以下 API。

https://api.hellopeter.com/consumer/business/telkom/reviews/appalling-service-cdc4559e8084e0db01dd6d7e807875460607ac77-2851593

加载第json一个并获取的键值review_content

import requests
import json
page = requests.get('https://api.hellopeter.com/consumer/business/telkom/reviews/appalling-service-cdc4559e8084e0db01dd6d7e807875460607ac77-2851593')
jsondata=json.loads(page.text)
print(jsondata['review_content'])

输出:

I have had the most horrific experience with Telkom, I have never dealt with such incompetence in my whole 31 years of being alive on earth. 

We opened a contract with Telkom for unlimited WIFI in our home. Instead of Telkom opening one account they opened two and delivered two routers to our home. Why? (Only God knows) I called and notified them, they advised they would send someone out to collect the router. 

两个多星期后,什么都没有解决!他们没有扣除约定的 R900 金额,而是扣除了 R3000。我打了好几次电话,问为什么还没有取消,因为这是他们的错误,我被告知他们不知道......(多么摇摆不定!)接下来的一个月我又被扣了 2000 多兰特。依然没有...

Everyday when I call I am told it will be canceled within 24hours or that someone will give me a call... but NOTHING! ABSOLUTE NOTHING! I have to constantly follow up and nag and I am always getting empty promises. I have called over 20 times for the same issue to be resolved.

The staff are incompetent and the agents have so much attitude and do not care about their customers. I am up to my head in frustration. This Morning I almost broke down in tears. How do they manage to not care at all? This month I received another message to say that they will debit another amount of over R2000.

It amazes me that when it comes to clients not paying in time their services are immediately terminated yet when they have to pay you your money it becomes such a drag. Talk about double standards.

I have never in my life experienced such emotional abuse from a service provider. I started questioning to myself, is it maybe because I am black? female? I am not too sure at this point. I just do not understand how hard could it be to fix an error that they made? It surely must be a literal click of a button or something. Why is it taking so long? We are in the THIRD MONTH now. Does Telkom care about it's customers? From this experience I believe they do not.

I am sick and tired of the excuses and I would just like everything to be sorted. I have been very patient and understanding with Telkom but they are just taking advantage now.  

推荐阅读