比较来自世界各地的卖家的域名和 IT 服务价格

未能表现 "Show more reviews" 在我的 webscraper

我试着用 Selenium, 但在执行按钮方面没有成功 "Show more reviews". 我正在尝试在网页上刮擦所有反馈。 我也遇到了所有评论的星级评级。 我会非常感谢帮助。
https://appgrooves.com/app/kot ... itive

import requests
from bs4 import BeautifulSoup
import pandas as pd

Final = []
URL = "[url=https://appgrooves.com/app/kotak-811-and-mobile-banking-by-kotak-mahindra-bank-ltd/positive"]https://appgrooves.com/app/kot ... ot%3B[/url]

r = requests.get/URL/
soup = BeautifulSoup/r.content, 'html.parser'/
reviews = [] # a list to store reviews

review_divs = soup.select/'div.tab-content'/
for element in review_divs :
review = {'Review_Title': 'appgrooves reviews', 'URL': ' ',
'Review': element.find/'div', {'class': ['body-content', 'collapse']}/.text,
'Stars' : len/element.find/'div', "rate-date-container"/.findAll/"i", "fas fa-star"//}
reviews.append/review/

Final.extend/reviews/

df = pd.DataFrame/Final/
print/df/
已邀请:

知食

赞同来自:

import requests
import pandas as pd
from bs4 import BeautifulSoup


url = "[url=https://appgrooves.com/app/kotak-811-and-mobile-banking-by-kotak-mahindra-bank-ltd/positive"]https://appgrooves.com/app/kot ... ot%3B[/url]
soup = BeautifulSoup/requests.get/url/.content, 'lxml'/

all_data = []
while True:
for r in soup.select/'[id^="positive_mosthelpful_reviews"]'/:
rating = r.select_one/'.rating-stars'/['class'][-1].split/'-'/[-1]
txt = r.select_one/'[id^="review-item-body"]'/.get_text/strip=True/

all_data.append/{'Review_Title': 'appgrooves reviews', 'URL': ' ',
'Review': txt, 'Stars': rating}/

print/rating/
print/txt/
print/'-' * 80/

btn = soup.select_one/'button:contains/"Show More Positive Reviews"/'/
if not btn:
break

data = requests.get/'https://appgrooves.com' + btn['data-url-ajax'], headers = {'X-Requested-With': 'XMLHttpRequest'}/.json//
soup = BeautifulSoup/data['data']['preview_html'], 'lxml'/

df = pd.DataFrame/all_data/
print/df/
df.to_csv/'data.csv'/


打印:


Review_Title URL Review Stars
0 appgrooves reviews Kotak bank has nice app, I hold several intern... 5
1 appgrooves reviews Kotak bank has nice app, I hold several intern... 5
2 appgrooves reviews I love using this app for its easiness except ... 4
3 appgrooves reviews New update and Face ID login made the app go f... 4
4 appgrooves reviews This is the best mobile banking apps that I ha... 5
5 appgrooves reviews I have used many Indian as well as global bank... 5
6 appgrooves reviews Update: I have un-installed the app and reinst... 5
7 appgrooves reviews Love the Kotak app totally, simple to use inte... 5
8 appgrooves reviews Very user friendly and at the same time loaded... 5
9 appgrooves reviews 2 days back I received mandatory update and af... 5
10 appgrooves reviews Best user friendly banking mobile app. Intuiti... 5
11 appgrooves reviews App not working after latest update which has ... 5
12 appgrooves reviews Connecting credit card payment / net banking /... 5
13 appgrooves reviews Takes few seconds to make credit card payment.... 5
14 appgrooves reviews I I really trust this app - it has multiple la... 5
15 appgrooves reviews This so far has turned out to be the fastest a... 5
16 appgrooves reviews I updated to the latest version of Kotak app, ... 3
17 appgrooves reviews The app is too good and was working fine until... 4


和savv.
data.csv

.

要回复问题请先登录注册