Я пытаюсь скрыть название, дату, рейтинг и фактический обзор каждого отзыва из уст в уста. Но я не могу извлечь что-либо из заголовка страницы. Обзор находится в
тег в классе «больше данных обзора». Я пробовал использовать несколько фрагментов кода из аналогичных проблем со стеком, но все равно получаю пустой список при использовании функции find()/findAll() для моих данных проверки.
Может ли кто-нибудь предложить какие-либо решения, чтобы не получать пустые списки при использовании функции findAll() для конкретных необходимых классов?
from bs4 import BeautifulSoup
import requests
url = 'https://www.mouthshut.com/product-reviews/berger-paints-reviews-925712965-page-4'
response = requests.get(url)
soup = BeautifulSoup(response.content, 'html.parser')
#to extract the reviews
for div in soup.find_all('div', class_='more reviewdata'):
for p in div.find_all('p'):
print(p.text)
soup.find_all('i', class_='icon-rating rated-star') #to extract the rating
#Similarly no outputs
soup.findAll('div')
Почему это отмечено тегом selenium
, хотя код на самом деле его не использует?
На этой странице используется сертификат SSL. Используйте verify=False
:
response = requests.get(url, verify=False)
Этот сайт является динамическим и получает данные по другой ссылке — https://www.mouthshut.com/Review/rar_reviews.aspx? вам нужно получить идентификатор ссылки и номер страницы https://www.mouthshut.com/product-reviews/berger-paints-reviews-**925712965**-page-**4**
import requests
from bs4 import BeautifulSoup
def get_reviews(page_id: int, page: int) -> list:
reviews = []
response = requests.get(f'https://www.mouthshut.com/Review/rar_reviews.aspx?cname=berger-paints&cid = {page_id}&page = {page}&forcount=255', verify=False)
soup = BeautifulSoup(response.text, 'lxml')
for review in soup.find_all('div', class_='row review-article'):
reviews.append({
'Name': review.findNext('div', class_='user-ms-name').get_text(),
'Locate': review.findNext('div', class_='usr-addr-text').get_text(),
'Stars': f"{len(review.find_all('i', class_='rated-star'))}/5",
'Description': review.findNext('div', class_='more reviewdata').get_text(strip=True)
})
return reviews
for data in get_reviews(925712965, 4):
print(data)
ВЫХОД:
{'Name': 'atripathybbsr', 'Locate': 'Bhubaneswar, India India', 'Stars': '4/5', 'Description': 'Seal-O-Prime used for interior and exterior coating and found the results highly satisfactory. The primer used lived up to the purposes described in the product information brochure.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'rknemirates', 'Locate': ' India', 'Stars': '1/5', 'Description': "Their customer service executive was not available whenever I needed him at the site. And there was no response from the Berger management about the complaint raised. Their supervisor didn't visit the site, but in the site visit report they mentioned that the customer service executive visited the site on the specific date. And at the work completion report I mentioned that I was not satisfied but they corrected as to read Fully Satisfied. I again lodged a complaint about this issue but till now there is no action from Berger.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort."}
{'Name': 'nidhimutha00', 'Locate': ' India', 'Stars': '1/5', 'Description': "Worst paint ever.. don't go for it they will ruined your home. A local painter even paint better...I mean they even don't know how to work.. so unprofessional they not even work timely but also don't work properly. seems like they don't know how to work they just appoint a teenager for paint who don't know anything about the work. I personally have to guide him even after that he don't do anything. Just came to work and sleep here. If you don't know your work please shut the company don't ruined some ones home after taking thousands of rupees. Such h disappointment you are.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort."}
{'Name': 'stunningmoon', 'Locate': ' India', 'Stars': '5/5', 'Description': 'The painters use automated tools like vacuum sander machine and roller. They also used furniture and floor plastic covers and took care of cleaning. Highly recommended.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'imovers_1', 'Locate': ' India', 'Stars': '1/5', 'Description': 'Most unprofessional approach by company representative.Paint quality is good . But whats the use, when there are defectspost painting with few days. That too, they donot attend . Once paid, they will forget you.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'dharaseth26', 'Locate': ' India', 'Stars': '1/5', 'Description': 'Hello Everyone,We got the express paint service. Even after paying a hefty amount we did not get a proper service. The most funny part was when they required to do a final touch up and Berger company do not make paints in small quantities, contractor used Asian Paints. Berger Sales officer said that it is a 5 years warranty and they will do the best.Anyways, exactly after a year, paint started peeling off and when we called them again they said its not Berger paint, we did not do the service. I have the final invoice, quote etc still they have stopped answering calls. I was talking to Head of CRM support and he stopped picking up calls as well.I have learnt a lesson, never believe these big companies because you are just 1 customer and they do not care for word of mouth or losing a loyal customer.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'omkarinteriorsbng', 'Locate': ' India', 'Stars': '1/5', 'Description': 'One year back I contacted berger paints customer service for painting my home and they sent executive by name uday and he gave an estimate and asked to pay some advance and also paid, but since then they are telling daily one or the other reason and post phoning and now not even pick call, please be careful.AnandFlag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'satgen', 'Locate': ' ', 'Stars': '2/5', 'Description': 'Last September we got our house painted by Berger Paints thinking we will get a professional work done. Totally disappointed. Here are some of the points where we felt cheated.1.They had subcontracted the painting job to save GST to a local painter which was not told to us at the time of signing the contract! We could as well have got a local painter to do the job at half the cost.Supervision of the work was almost nil. Supervisor came for just 5 mins in the morning and 5 mins in the evening, that too not everyday. We had to do all the supervision!No covid protocols were followed, another promise brokenCovering of the furniture, switch boards and other fixtures were very shabby and later the cleaning of these was also not up to the mark. We had to force them to do both the covering and cleaning. Floors were not covered at all in spite of us requesting them to do so.Paint job was also not up to the mark, Streaks were seen, filling of cracks were clearly visible even after 2 coats of paint.No modern tools were used to do the sanding and wall putty. They did it manually causing lot of dust and mess.Worst of all, terracotta painting done in open spaces peeled off in 4 months time . A complaint given in April is yet to be attended.All in all it was a big let down by berger paints.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'aish18khin', 'Locate': ' India', 'Stars': '1/5', 'Description': 'Having used Berger Paints Express Painting Service in July 2021, I would like to share my experience.contractors only asking for money for half the work done. we got everything cleaned and completed by another painter and now they are asking for money after 2 months … who keeps half the work done obviously if the contractor isn’t showing up we will hire someone else to do the same job … now asking for money for something which he hasn’t done isn’t good.Waste of money and energy. And also they do trick and confuse you on the first and 2nd coats. No safety for corona. No proper tools like sheets or anything to avoid spilling over. Overall worst. Never ever go for Berger. Better to check local guys and do with Asian paints. No one was there for cleaning .The actual services provided differed quality and substance Berger were disappointed when low-quality services are offered and we feel cheated.The presence of Berger Paints was felt only up to supplying the quotation; there was hardly any supervision or tech support thereafter. there was no advantage in having Berger paints by my side. In fact, I believe that I could have saved money by getting this work done on my own and achieve the same results.Overall, the experience was below average and left me unsatisfied, and the services provided were pathetic.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'vneeju', 'Locate': ' India', 'Stars': '1/5', 'Description': "Pls dont opt or waste time in Berger painting I Chennai especially. Worst material and labour. The team who came for painting can do both asian paints as well as Berger. Not sure how same team works for competitors. And also don't go for rolling on exterior it doesn't stick yo the walls all the layer is getting peeled off in just 3 months. Waste of money and energy. And also they do trick and confuse you on the first and 2nd coat . No safety for corona . No proper tools like sheets or anything to avoid spilling over. Overall worst. Never ever go for Berger. Better to check local guy and do with asian paints.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort."}
{'Name': 'puneetkapoorca', 'Locate': ' India', 'Stars': '1/5', 'Description': 'Having used Berger Paints Express Painting Service in Mar-Apr 2021, I would like to share my experience.The actual services provided differed substantially from what the company advertised on its website/print media particularly in terms of the 8 step approach or providing a dust free environment or post paint clean up or using tech to do the painting. All these are just on paper and practiced say to an extent of just 10-15% of what is professed. There was a lack of finesse in the job. Therefore, people like me who rely upon the services offered by a reputed company like Berger were disappointed when low quality services are offered and we feel cheated.The presence of Berger Paints was felt only up to supplying the quotation; there was hardly any supervision or tech support thereafter. Later I learnt that the position of Supervisor was vacant in NOIDA but this was not communicated to me at the time of initial discussions. Therefore, in the end I did all the activities that I would have done otherwise had I engaged a contractor of my own - there was no advantage in having Berger paints by my side. In fact, I believe that I could have saved money by getting this work done on my own and achieve the same results.Overall, the experience was below average and left me unsatisfied, and services provided were pathetic.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'seeratdhillon96', 'Locate': ' India', 'Stars': '1/5', 'Description': 'We got our house painted and roof water proofed with Berger, it is the worst product and customer service. It claims to have 10 year warranty but our roof is leaking after just 5 months have been contacting the company and everyone I speak to seems to have left the company no one is responding. It is such a big waste of money please don’t fall for this scam. My roof is worse than it was to begin with HUGE SCAM stay away from Berger.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'niki_jdh', 'Locate': 'Mumbai India', 'Stars': '1/5', 'Description': 'We booked the painting service through their website. After few days we found out that the finishing and cleaning was not done properly, there were bumps, waves, and patches on the wall and ceiling. We sent pictures to the contractor and CE as well the CE came and saw but after that there is no response from there end. We have been following up but it feels that they don’t have interest. Attaching the pictures. Never go for Berger paints quality of paint is also not good. Asian paints is anytime better the Berger paints.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'sonukrdbg177', 'Locate': '- India', 'Stars': '5/5', 'Description': 'The company offers quality colorful paints for their costumers includes home owners, professional and industrial users, because of its quality products the company attained instant recognition worldwide. They work towards to meet quality requirements of the domestic market. OkFlag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'satyatruelight', 'Locate': ' India', 'Stars': '1/5', 'Description': 'Berger paints - They are pretty bad at texture painting, what was shown in the pic and what was done was completely different. I complained to the site engineer as well he said he will get back and did not revert. When we get the painting done, we need experts to help us choose colours. I did not see that professionalism in them. Anyways they did a nice job generally, cleaned the place and leftFlag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'anshakkumar98', 'Locate': ' India', 'Stars': '1/5', 'Description': 'I used it in my house worst paint, worst quality, worst smell, worst looks and worst holding capacity was bad for the walls also.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'drchandrashekhar', 'Locate': ' India', 'Stars': '1/5', 'Description': 'I engaged Berger Paints’ painting service to paint a portion of my flat about a year and half ago. The paint has started peeling off and the place is looking like the patched skin of a giraffe. Worst part is that this cost me three time the cost of getting the work done through a local painter.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
{'Name': 'raj9acs', 'Locate': 'Hyderabad India', 'Stars': '1/5', 'Description': "Dear Readers,Never go for Berger Paints its waste of your HARD-EARNED MONEY, I'm from Hyderabad I have painted my whole building exterior at the time of painting the executive promised we give 7years warranty if paint peel of and it gets shaded, I have been offered to paint wheather proof and dust proof paint and what not everything high end paint.I'm still in warranty period now paint is peeling of and shading the color and I have complained to customer care and now the person came and he checked for 5minutes and went off and sending emails that the moisture level is 16%-20% and this due to your wall breaks and what not many things all are bullshit, by the way my building is constructed just 6yrs ago and wall conditions and very good and no cracks nothing, at time of getting paint the executive asked to sign me the form which is signed by some contractor name and executive said that he is the company person they CHEAT the customers like this way never sign any form with CONTRACTOR NAME AND DONT GO FOR ALL THIS BULLSHIT IDIOT COMPANY THEY NEVER LISTEN TO CUSTOMERS. YOU WILL CHEAT IF YOU GO FOR THIS BERGER PAINTS.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort."}
{'Name': 'py161698', 'Locate': ' India', 'Stars': '1/5', 'Description': "We have painted our house with Berger paint 2 months ago....now paint is looking very terrible....don't like the paint quality.....I wish I could show the image ...Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort."}
{'Name': 'godwintx', 'Locate': ' India', 'Stars': '1/5', 'Description': 'Exactly 2 years before by brother within my compound used paint so called "Long Life" and they assured it would last for 10 years or so. Unfortunately after single monsoon season it faded color and darkish black colour on the wall. Immediately he called the supplier and fixed appointment with berger expert for site visit. I reckon his name was Rohit, astonishing fact is that without proper testing even without touching the surface where we painted the area he concluded that its because of DUST. Let me ask you one thing dust is not created by us, its all over the world. Only to overcome this dust propaganda we spent this much money to buy berger short life products. We both stopped buying this brand start telling this incident to my near and dear. Its nothing but a cheating by using bollywood star in advertising.Flag This ReviewIrrelevantFakeJunkThank You! We appreciate your effort.'}
Я предполагаю, что это потому, что вы используете
requests
, который не может обрабатывать JavaScript.