如何仅抓取评论文本并避免获取其他元素的内容?

huangapple go评论88阅读模式
英文:

How to scrape only the text of reviews and avoid content from other elements?

问题

以下是您要翻译的内容:

I am trying to extract reviews only from the webpages downloaded locally.

WebPage Link: https://www.airbnb.co.in/rooms/605371928419351152?adults=1&category_tag=Tag%3A677&children=0&enable_m3_private_room=false&infants=0&pets=0&search_mode=flex_destinations_search&check_in=2023-04-09&check_out=2023-04-14&federated_search_id=da4d5c1e-7ad2-4539-8658-5f27dde826f8&source_impression_id=p3_1680264622_sNnLDFQJLlbBR4%2Fw

I tried the following approach:

Loop through all files in the folder

for filename in os.listdir(folder_path):
try:
with open(os.path.join(folder_path, filename), encoding="utf8") as f:
html_content = f.read()

        # Parse the HTML content using BeautifulSoup
        soup = BeautifulSoup(html_content, "html.parser")

        # Find all the tags with class "container"
        containers = soup.find_all(class_='ll4r2nl dir dir-ltr')

        for container in containers:
            print(container.text)
            print('**********************************************')

except Exception as error:
    continue

I am able to get the reviews but there is other unwanted text also. Please help me to get reviews only.

Current Output

Jannat blends the most luxurious backdrop of your fantasy with nature’s incredible marvels to create a tranquil utopia that caters to your comfort where Breakfast is complimentary! This 3Bed pool villa in Nashik is a hidden paradise waiting to dazzle you with its tranquil charm.Surrounded by nature as far as the eyes can see,the open lawns within the premises give you all the space you need to take a refreshing walk,practice your morning asanas or indulge your kids in a fun game of catch&cook.The space•This villa offers 3 spacious bedrooms and ensuite bathrooms in 2 bedrooms, giving you ample space to have a luxurious getaway from the congested city life. With an elderly-friendly approach in mind, 1 bedroom of the villa is situated on the ground level, where your elderly parents can rest in comfort without having to make their way up the stairs. •The 2 bedrooms on the first floor can be occupied by younger couples and children. These rooms offer spectacular views of Waldevi lake so you can wake up and head to the windows allowing the cool breeze to gently embrace you. Spend some time in the living room gazing at the garden outside or turn the vast room into your personal dancefloor or karaoke zone. As beautiful as its surroundings are, the villa itself charms you with its decor and makes you want to stay indoors. • Challenge your friends and family members with exciting and fun games, such as table tennis, table hockey, carrom and other board games and discover who’s the best player in the group. Dip your feet in the swimming pool, or take a deep dive and wash away the heat during a sweltering afternoon. If it's a chilly winter's day, head out to the loungers after breakfast to soak in some sun. No matter the weather, this villa has everything indoors and outdoors to create the perfect vacation setting for you! Missing out on your workouts while on


This was a great find for us. Akash was our host for the stay. He was quite proactive in sharing with us instructions/information pertaining to the stay, followed-through diligently with the requisite actions, and was very responsive to the queries/additional-requests placed by us. Coming to the property itself - it's exactly as it looks in the pictures and perhaps prettier at this time of the year when there is a chill in the weather. The views from the living room and the 1st floor rooms are amazing. We couldnt try the pool owing to the chilly weather but it's kept quite clean and so is the garden area. It's around 40 mins drive from most of the to-visit places in/around nashik. The place is quite secure and the staff stays at the property.Coming to the people, Sonu and Shobha did their best to make us feel-at-home. Jeetendra was very keen to make this stay a foodie&#39's delight with his expansive menu and the barbeque. And ofcourse we loved hanging out with Cocktail. Thank you all!!


We had an amazing stay. The staff was very competent and made our stay fabulous. We will highly recommend this place to our family and friends.


We really enjoyed two days at this property. The villa as well as the entire property are well maintained. The view of lake as well as mountains are breathtaking. Very helpful care takers and food food.


Enjoy boating on the backwaters of Waldevi Lake, a 20-minute drive complemented by amazing views. Adventure and culture combine at the Pandav Leni Caves, where you can set up your hiking trails, 20 minutes from the villa. Your lessons in history await at the Gadgada, Ranjangiri and Bahula forts, 5 to 15 minutes from villa.


Hi! I’m Shreya and I’m eager to host families and friends in our private villas, on behalf of Saffron Stays , a leading private villa rental & luxury hospitality start-up. Come rain or shine, I absolutely love travelling. From the exhilarating reverse bungee in Panchgani to the calming hill to Munnar, I love to explore places across the country that are brimming with rich culture and heritage! Mentally I’m always planning a trip to a new beach destination, so share your reccos with me!


Hi! I’m Shreya and I’m eager to host families and friends in our private villas, on behalf of Saffron Stays , a leading private villa rental & luxury hospitality start-up. Come…


we have a care team present on the villa to take care.


Superhosts are experienced, highly rated hosts who are committed to providing great stays for guests.


English, हिन्दी


100%


within an hour


Cancel before 2 Apr for a partial refund.


Review the Host’s full cancellation policy which applies even if you cancel for illness or disruptions caused by COVID-19.



Expected Output

This was a great find for us. Akash was our host for the stay. He was quite proactive in sharing with us instructions/information pertaining to the stay, followed-through diligently with the requisite actions, and was very responsive to the queries/additional-requests placed by us. Coming to the property itself - it's exactly as it looks in the pictures and perhaps prettier at this time of the year when there is a chill in the weather. The views from the living room and the 1st floor rooms are amazing. We couldnt try the

英文:

I am trying to extract reviews only from the webpages downloaded locally.

WebPage Link: https://www.airbnb.co.in/rooms/605371928419351152?adults=1&category_tag=Tag%3A677&children=0&enable_m3_private_room=false&infants=0&pets=0&search_mode=flex_destinations_search&check_in=2023-04-09&check_out=2023-04-14&federated_search_id=da4d5c1e-7ad2-4539-8658-5f27dde826f8&source_impression_id=p3_1680264622_sNnLDFQJLlbBR4%2Fw

I tried the following approach:

# Loop through all files in the folder
for filename in os.listdir(folder_path):
    try:
        with open(os.path.join(folder_path, filename), encoding="utf8") as f:
            html_content = f.read()

            # Parse the HTML content using BeautifulSoup
            soup = BeautifulSoup(html_content, "html.parser")

            # Find all the tags with class "container"
            containers = soup.find_all(class_='ll4r2nl dir dir-ltr')

            for container in containers:
                print(container.text)
                print('**********************************************')

    except Exception as error:
        continue

I am able to get the reviews but there is other unwanted text also. Please help me to get reviews only.

Current Output

Jannat blends the most luxurious backdrop of your fantasy with nature’s incredible marvels to create a tranquil utopia that caters to your comfort where Breakfast is complimentary! This 3Bed pool villa in Nashik is a hidden paradise waiting to dazzle you with its tranquil charm.Surrounded by nature as far as the eyes can see,the open lawns within the premises give you all the space you need to take a refreshing walk,practice your morning asanas or indulge your kids in a fun game of catch&cook.The space•This villa offers 3 spacious bedrooms and ensuite bathrooms in 2 bedrooms, giving you ample space to have a luxurious getaway from the congested city life. With an elderly-friendly approach in mind, 1 bedroom of the villa is situated on the ground level, where your elderly parents can rest in comfort without having to make their way up the stairs. •The 2 bedrooms on the first floor can be occupied by younger couples and children. These rooms offer spectacular views of Waldevi lake so you can wake up and head to the windows allowing the cool breeze to gently embrace you. Spend some time in the living room gazing at the garden outside or turn the vast room into your personal dancefloor or karaoke zone. As beautiful as its surroundings are, the villa itself charms you with its decor and makes you want to stay indoors. • Challenge your friends and family members with exciting and fun games, such as table tennis, table hockey, carrom and other board games and discover who’s the best player in the group. Dip your feet in the swimming pool, or take a deep dive and wash away the heat during a sweltering afternoon. If it's a chilly winter's day, head out to the loungers after breakfast to soak in some sun. No matter the weather, this villa has everything indoors and outdoors to create the perfect vacation setting for you! Missing out on your workouts while on
**********************************************
This was a great find for us. Akash was our host for the stay. He was quite proactive in sharing with us instructions/information pertaining to the stay, followed-through diligently with the requisite actions, and was very responsive to the queries/additional-requests placed by us. Coming to the property itself - it's exactly as it looks in the pictures and perhaps prettier at this time of the year when there is a chill in the weather. The views from the living room and the 1st floor rooms are amazing. We couldnt try the pool owing to the chilly weather but it's kept quite clean and so is the garden area. It's around 40 mins drive from most of the to-visit places in/around nashik. The place is quite secure and the staff stays at the property.Coming to the people, Sonu and Shobha did their best to make us feel-at-home. Jeetendra was very keen to make this stay a foodie's delight with his expansive menu and the barbeque. And ofcourse we loved hanging out with Cocktail. Thank you all!!
**********************************************
We had an amazing  stay. The staff was very competent and made our stay fabulous. We will highly recommend this place to our family and friends.
**********************************************
We really enjoyed two days at this property. The villa as well as the entire property are well maintained. The view of lake as well as mountains are breathtaking. Very helpful care takers and food food.
**********************************************
Enjoy boating on the backwaters of Waldevi Lake, a 20-minute drive complemented by amazing views. Adventure and culture combine at the Pandav Leni Caves, where you can set up your hiking trails, 20 minutes from the villa. Your lessons in history await at the Gadgada, Ranjangiri and Bahula forts, 5 to 15 minutes from  villa.
**********************************************
Hi! I’m Shreya and I’m eager to host families and friends in our private villas, on behalf of Saffron Stays , a leading private villa rental & luxury hospitality start-up. Come rain or shine, I absolutely love travelling. From the exhilarating reverse bungee in Panchgani to the calming hill to Munnar, I love to explore places across the country that are brimming with rich culture and heritage! Mentally I’m always planning a trip to a new beach destination, so share your reccos with me!
**********************************************
Hi! I’m Shreya and I’m eager to host families and friends in our private villas, on behalf of Saffron Stays , a leading private villa rental & luxury hospitality start-up. Come… 
**********************************************
we have a care team present on the villa to take care.
**********************************************
Superhosts are experienced, highly rated hosts who are committed to providing great stays for guests.
**********************************************
English, हिन्दी
**********************************************
100%
**********************************************
within an hour
**********************************************
Cancel before 2 Apr for a partial refund.
**********************************************
Review the Host’s full cancellation policy which applies even if you cancel for illness or disruptions caused by COVID-19.
**********************************************

Expected Output

This was a great find for us. Akash was our host for the stay. He was quite proactive in sharing with us instructions/information pertaining to the stay, followed-through diligently with the requisite actions, and was very responsive to the queries/additional-requests placed by us. Coming to the property itself - it's exactly as it looks in the pictures and perhaps prettier at this time of the year when there is a chill in the weather. The views from the living room and the 1st floor rooms are amazing. We couldnt try the pool owing to the chilly weather but it's kept quite clean and so is the garden area. It's around 40 mins drive from most of the to-visit places in/around nashik. The place is quite secure and the staff stays at the property.Coming to the people, Sonu and Shobha did their best to make us feel-at-home. Jeetendra was very keen to make this stay a foodie's delight with his expansive menu and the barbeque. And ofcourse we loved hanging out with Cocktail. Thank you all!!
**********************************************
We had an amazing  stay. The staff was very competent and made our stay fabulous. We will highly recommend this place to our family and friends.
**********************************************
We really enjoyed two days at this property. The villa as well as the entire property are well maintained. The view of lake as well as mountains are breathtaking. Very helpful care takers and food food.

答案1

得分: 1

尝试选择更具体的元素,例如使用css选择器选择每个评论的容器,使用属性data-review-id选择,然后选择其子元素span,类名为dir-ltr

containers = page.select('[data-review-id] span.dir-ltr')

如何使用selenium获取带有评论的page_source请查看此问题

示例:
from bs4 import BeautifulSoup
html = '''<div class="c8b3k5d dir dir-ltr" data-testid="modal-container"><div class="pzqlnu dir dir-ltr">...'''
page = BeautifulSoup(html, 'html.parser')

containers = page.select('[data-review-id] span.dir-ltr')

for container in containers:
    print(container.text)
    print('**********************************************')
输出:
这对我们来说是个很好的发现。 Akash是我们住宿的主人。 他非常主动地与我们分享与住宿相关的指示/信息,认真跟进必要的行动,并对我们提出的查询/额外请求做出了很快的响应。 谈到物业本身 - 它与图片中看到的一样,也许在这个时候,天气有点寒冷,它看起来更漂亮。 客厅和一楼的房间的视野是惊人的。 由于天气寒冷,我们没能尝试游泳池,但它保持得很干净,花园区也是如此。 距离纳什克周围大多数要参观的地方约40分钟车程。 这个地方相当安全,工作人员住在物业里。 谈到人,Sonu和Shobha尽了最大的努力让我们感到宾至如归。 Jeetendra非常热衷于通过他丰富的菜单和烧烤使这次住宿成为美食家的乐趣。 当然,我们很喜欢和Cocktail一起玩。 谢谢大家!
**********************************************
我们度过了一个令人惊叹的时光。 员工非常称职,使我们的住宿变得精彩。 我们将强烈推荐这个地方给我们的家人和朋友。
**********************************************
我们在这个地方度过了愉快的两天。 别墅以及整个物业都保持得很好。 湖泊和山脉的景色令人叹为观止。 保姆非常乐于助人,食物也很美味。
**********************************************
英文:

Try to select your elements more specific for example with css selectors that select the container of each review by attribute data-review-id and than its child span with class dir-ltr:

containers = page.select(&#39;[data-review-id] span.dir-ltr&#39;)

How to get the page_source with reviews we are working on with selenium check this question

Example:
from bs4 import BeautifulSoup
html = &#39;&#39;&#39;&lt;div class=&quot;c8b3k5d dir dir-ltr&quot; data-testid=&quot;modal-container&quot;&gt;&lt;div class=&quot;pzqlnu dir dir-ltr&quot;&gt;&lt;div class=&quot;f1cwbdmm dir dir-ltr&quot; aria-hidden=&quot;true&quot; tabindex=&quot;0&quot;&gt;&lt;/div&gt;&lt;div class=&quot;pzqlnu dir dir-ltr&quot;&gt;&lt;div role=&quot;dialog&quot; aria-modal=&quot;true&quot; class=&quot;d1k13iig dfhid5c dir dir-ltr&quot; style=&quot;position: relative;&quot;&gt;&lt;div class=&quot;c10hl6ue dir dir-ltr&quot;&gt;&lt;button aria-label=&quot;Close&quot; type=&quot;button&quot; class=&quot;l1j9v1wn czcfm7x dir dir-ltr&quot;&gt;&lt;span class=&quot;i1h5tsj6 dir dir-ltr&quot;&gt;&lt;svg viewBox=&quot;0 0 32 32&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; role=&quot;presentation&quot; focusable=&quot;false&quot; style=&quot;display: block; fill: none; height: 16px; width: 16px; stroke: currentcolor; stroke-width: 3px; overflow: visible;&quot;&gt;&lt;path d=&quot;m6 6 20 20&quot;&gt;&lt;/path&gt;&lt;path d=&quot;m26 6-20 20&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;/button&gt;&lt;/div&gt;&lt;div class=&quot;_1lplc7&quot;&gt;&lt;/div&gt;&lt;div class=&quot;_17itzz4&quot; style=&quot;padding: 0px 24px;&quot;&gt;&lt;div tabindex=&quot;0&quot; class=&quot;_1seuw5go&quot;&gt;&lt;div class=&quot;_1a5fl1v&quot;&gt;&lt;div class=&quot;_3hmsj&quot;&gt;&lt;section&gt;&lt;div class=&quot;c6req26 dir dir-ltr&quot;&gt;&lt;div class=&quot;_1af3y1dh&quot;&gt;&lt;div class=&quot;_1v5dfva&quot;&gt;&lt;div class=&quot;_t42qolv&quot;&gt;&lt;h2 tabindex=&quot;-1&quot; class=&quot;hghzvl1 dir dir-ltr&quot; elementtiming=&quot;LCP-target&quot;&gt;&lt;span class=&quot;_1auokh4&quot;&gt;&lt;svg viewBox=&quot;0 0 32 32&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; role=&quot;presentation&quot; focusable=&quot;false&quot; style=&quot;display: block; height: 24px; width: 24px; fill: currentcolor;&quot;&gt;&lt;path d=&quot;M15.094 1.579l-4.124 8.885-9.86 1.27a1 1 0 0 0-.542 1.736l7.293 6.565-1.965 9.852a1 1 0 0 0 1.483 1.061L16 25.951l8.625 4.997a1 1 0 0 0 1.482-1.06l-1.965-9.853 7.293-6.565a1 1 0 0 0-.541-1.735l-9.86-1.271-4.127-8.885a1 1 0 0 0-1.814 0z&quot; fill-rule=&quot;evenodd&quot;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;5.0 &#183; 3 reviews&lt;/h2&gt;&lt;/div&gt;&lt;div class=&quot;_13qdk1f&quot;&gt;&lt;div class=&quot;c6req26 dir dir-ltr&quot;&gt;&lt;div class=&quot;_yorrb7h&quot;&gt;&lt;div class=&quot;_t6qflv&quot;&gt;&lt;div class=&quot;_a3qxec&quot;&gt;&lt;div class=&quot;_y1ba89&quot;&gt;Cleanliness&lt;/div&gt;&lt;div class=&quot;_tk5b0r&quot;&gt;&lt;div class=&quot;_7pay&quot; aria-label=&quot;5.0 out of 5.0&quot; role=&quot;img&quot;&gt;&lt;span class=&quot;_1hewo85&quot; style=&quot;width: 100%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;_4oybiu&quot; aria-hidden=&quot;true&quot;&gt;5.0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;_yorrb7h&quot;&gt;&lt;div class=&quot;_t6qflv&quot;&gt;&lt;div class=&quot;_a3qxec&quot;&gt;&lt;div class=&quot;_y1ba89&quot;&gt;Accuracy&lt;/div&gt;&lt;div class=&quot;_tk5b0r&quot;&gt;&lt;div class=&quot;_7pay&quot; aria-label=&quot;5.0 out of 5.0&quot; role=&quot;img&quot;&gt;&lt;span class=&quot;_1hewo85&quot; style=&quot;width: 100%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;_4oybiu&quot; aria-hidden=&quot;true&quot;&gt;5.0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;_yorrb7h&quot;&gt;&lt;div class=&quot;_t6qflv&quot;&gt;&lt;div class=&quot;_a3qxec&quot;&gt;&lt;div class=&quot;_y1ba89&quot;&gt;Communication&lt;/div&gt;&lt;div class=&quot;_tk5b0r&quot;&gt;&lt;div class=&quot;_7pay&quot; aria-label=&quot;5.0 out of 5.0&quot; role=&quot;img&quot;&gt;&lt;span class=&quot;_1hewo85&quot; style=&quot;width: 100%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;_4oybiu&quot; aria-hidden=&quot;true&quot;&gt;5.0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;_yorrb7h&quot;&gt;&lt;div class=&quot;_t6qflv&quot;&gt;&lt;div class=&quot;_a3qxec&quot;&gt;&lt;div class=&quot;_y1ba89&quot;&gt;Location&lt;/div&gt;&lt;div class=&quot;_tk5b0r&quot;&gt;&lt;div class=&quot;_7pay&quot; aria-label=&quot;5.0 out of 5.0&quot; role=&quot;img&quot;&gt;&lt;span class=&quot;_1hewo85&quot; style=&quot;width: 100%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;_4oybiu&quot; aria-hidden=&quot;true&quot;&gt;5.0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;_yorrb7h&quot;&gt;&lt;div class=&quot;_t6qflv&quot;&gt;&lt;div class=&quot;_a3qxec&quot;&gt;&lt;div class=&quot;_y1ba89&quot;&gt;Check-in&lt;/div&gt;&lt;div class=&quot;_tk5b0r&quot;&gt;&lt;div class=&quot;_7pay&quot; aria-label=&quot;5.0 out of 5.0&quot; role=&quot;img&quot;&gt;&lt;span class=&quot;_1hewo85&quot; style=&quot;width: 100%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;_4oybiu&quot; aria-hidden=&quot;true&quot;&gt;5.0&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;_yorrb7h&quot;&gt;&lt;div class=&quot;_t6qflv&quot;&gt;&lt;div class=&quot;_a3qxec&quot;&gt;&lt;div class=&quot;_y1ba89&quot;&gt;Value&lt;/div&gt;&lt;div class=&quot;_tk5b0r&quot;&gt;&lt;div class=&quot;_7pay&quot; aria-label=&quot;4.7 out of 5.0&quot; role=&quot;img&quot;&gt;&lt;span class=&quot;_1hewo85&quot; style=&quot;width: 94%;&quot;&gt;&lt;/span&gt;&lt;/div&gt;&lt;span class=&quot;_4oybiu&quot; aria-hidden=&quot;true&quot;&gt;4.7&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;_lao3nn&quot;&gt;&lt;div class=&quot;_1v5dfva&quot;&gt;&lt;div class=&quot;_13qdk1f&quot;&gt;&lt;div class=&quot;cvyfggr dir dir-ltr&quot;&gt;&lt;div class=&quot;lol0vti dir dir-ltr&quot;&gt;&lt;svg viewBox=&quot;0 0 32 32&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; aria-hidden=&quot;true&quot; role=&quot;presentation&quot; focusable=&quot;false&quot; style=&quot;display: block; fill: none; height: 16px; width: 16px; stroke: currentcolor; stroke-width: 2px; overflow: visible;&quot;&gt;&lt;g fill=&quot;none&quot;&gt;&lt;path d=&quot;m13 24c6.0751322 0 11-4.9248678 11-11 0-6.07513225-4.9248678-11-11-11-6.07513225 0-11 4.92486775-11 11 0 6.0751322 4.92486775 11 11 11zm8-3 9 9&quot;&gt;&lt;/path&gt;&lt;/g&gt;&lt;/svg&gt;&lt;/div&gt;&lt;label class=&quot;i19s91t4 dir dir-ltr&quot; for=&quot;reviews-search-input&quot;&gt;&lt;div dir=&quot;ltr&quot;&gt;&lt;div class=&quot;id4k8i2 dir dir-ltr&quot;&gt;&lt;input aria-label=&quot;Search reviews, Press ‘Enter’ to search&quot; class=&quot;ih1c1h dir dir-ltr&quot; id=&quot;reviews-search-input&quot; autocomplete=&quot;off&quot; type=&quot;text&quot; aria-describedby=&quot;&quot; placeholder=&quot;Search reviews&quot;&gt;&lt;/div&gt;&lt;/div&gt; &lt;/label&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div data-testid=&quot;pdp-reviews-modal-scrollable-panel&quot;&gt;&lt;div class=&quot;r1are2x1 dir dir-ltr&quot; data-review-id=&quot;785930080856248655&quot;&gt;&lt;div&gt;&lt;div class=&quot;chnzxuf c9gtck5 dir dir-ltr&quot;&gt;&lt;div class=&quot;t11wgnhd dir dir-ltr&quot; id=&quot;review_785930080856248655_title&quot;&gt;&lt;h3 tabindex=&quot;-1&quot; class=&quot;hghzvl1 dir dir-ltr&quot; elementtiming=&quot;LCP-target&quot;&gt;Vaibhav&lt;/h3&gt;&lt;div class=&quot;s15w4qkt dir dir-ltr&quot;&gt;&lt;div class=&quot;s189e1ab dir dir-ltr&quot;&gt;&lt;ol class=&quot;_7h1p0g&quot;&gt;&lt;li theme=&quot;[object Object]&quot; class=&quot;_1f1oir5&quot;&gt;December 2022&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;_e7hn5&quot; style=&quot;height: 40px; width: 40px;&quot;&gt;&lt;a target=&quot;_blank&quot; aria-label=&quot;Vaibhav&quot; href=&quot;/users/show/32972705&quot; class=&quot;_9bezani l1j9v1wn dir dir-ltr&quot;&gt;&lt;div class=&quot;_1c81x67&quot; style=&quot;height: 40px; width: 40px; border-radius: 50%;&quot;&gt;&lt;div class=&quot;dqra4ro bztshid dir dir-ltr&quot; role=&quot;img&quot; aria-busy=&quot;false&quot; aria-label=&quot;Vaibhav&quot; style=&quot;--dls-liteimage-height:100%; --dls-liteimage-width:100%; --dls-liteimage-background-image:url(&amp;quot;data:image/png;base64,null&amp;quot;); --dls-liteimage-background-size:cover;&quot;&gt;&lt;img class=&quot;irqavcc i1mla2as i1cqnm0r dir dir-ltr&quot; aria-hidden=&quot;true&quot; alt=&quot;Vaibhav&quot; decoding=&quot;async&quot; elementtiming=&quot;LCP-target&quot; src=&quot;https://a0.muscache.com/im/users/32972705/profile_pic/1431189588/original.jpg?im_w=240&quot; data-original-uri=&quot;https://a0.muscache.com/im/users/32972705/profile_pic/1431189588/original.jpg?im_w=240&quot; style=&quot;--dls-liteimage-object-fit:cover;&quot;&gt;&lt;div class=&quot;reglew bztshid dqqltwe dir dir-ltr&quot; style=&quot;--dls-liteimage-background-size:cover; --dls-liteimage-background-image:url(https\:\/\/a0\.muscache\.com\/im\/users\/32972705\/profile_pic\/1431189588\/original\.jpg\?im_w\=240);&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;line-height: 24px;&quot;&gt;&lt;span&gt;&lt;span class=&quot;ll4r2nl dir dir-ltr&quot;&gt;This was a great find for us. Akash was our host for the stay. He was quite proactive in sharing with us instructions/information pertaining to the stay, followed-through diligently with the requisite actions, and was very responsive to the queries/additional-requests placed by us. &lt;br&gt;Coming to the property itself - it&#39;s exactly as it looks in the pictures and perhaps prettier at this time of the year when there is a chill in the weather. The views from the living room and the 1st floor rooms are amazing. We couldnt try the pool owing to the chilly weather but it&#39;s kept quite clean and so is the garden area. It&#39;s around 40 mins drive from most of the to-visit places in/around nashik. The place is quite secure and the staff stays at the property.&lt;br&gt;Coming to the people, Sonu and Shobha did their best to make us feel-at-home. Jeetendra was very keen to make this stay a foodie&#39;s delight with his expansive menu and the barbeque. And ofcourse we loved hanging out with Cocktail. Thank you all!!&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;r1are2x1 dir dir-ltr&quot; data-review-id=&quot;717127665095387993&quot;&gt;&lt;div&gt;&lt;div class=&quot;chnzxuf c9gtck5 dir dir-ltr&quot;&gt;&lt;div class=&quot;t11wgnhd dir dir-ltr&quot; id=&quot;review_717127665095387993_title&quot;&gt;&lt;h3 tabindex=&quot;-1&quot; class=&quot;hghzvl1 dir dir-ltr&quot; elementtiming=&quot;LCP-target&quot;&gt;Nivi&lt;/h3&gt;&lt;div class=&quot;s15w4qkt dir dir-ltr&quot;&gt;&lt;div class=&quot;s189e1ab dir dir-ltr&quot;&gt;&lt;ol class=&quot;_7h1p0g&quot;&gt;&lt;li theme=&quot;[object Object]&quot; class=&quot;_1f1oir5&quot;&gt;September 2022&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;_e7hn5&quot; style=&quot;height: 40px; width: 40px;&quot;&gt;&lt;a target=&quot;_blank&quot; aria-label=&quot;Nivi&quot; href=&quot;/users/show/52872820&quot; class=&quot;_9bezani l1j9v1wn dir dir-ltr&quot;&gt;&lt;div class=&quot;_1c81x67&quot; style=&quot;height: 40px; width: 40px; border-radius: 50%;&quot;&gt;&lt;div class=&quot;dqra4ro bztshid dir dir-ltr&quot; role=&quot;img&quot; aria-busy=&quot;false&quot; aria-label=&quot;Nivi&quot; style=&quot;--dls-liteimage-height:100%; --dls-liteimage-width:100%; --dls-liteimage-background-image:url(&amp;quot;data:image/png;base64,null&amp;quot;); --dls-liteimage-background-size:cover;&quot;&gt;&lt;img class=&quot;irqavcc i1mla2as i1cqnm0r dir dir-ltr&quot; aria-hidden=&quot;true&quot; alt=&quot;Nivi&quot; decoding=&quot;async&quot; elementtiming=&quot;LCP-target&quot; src=&quot;https://a0.muscache.com/im/pictures/user/ac0f7050-e688-4ccc-9358-011fdf8abc30.jpg?im_w=240&quot; data-original-uri=&quot;https://a0.muscache.com/im/pictures/user/ac0f7050-e688-4ccc-9358-011fdf8abc30.jpg?im_w=240&quot; style=&quot;--dls-liteimage-object-fit:cover;&quot;&gt;&lt;div class=&quot;reglew bztshid dqqltwe dir dir-ltr&quot; style=&quot;--dls-liteimage-background-size:cover; --dls-liteimage-background-image:url(https\:\/\/a0\.muscache\.com\/im\/pictures\/user\/ac0f7050-e688-4ccc-9358-011fdf8abc30\.jpg\?im_w\=240);&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;line-height: 24px;&quot;&gt;&lt;span&gt;&lt;span class=&quot;ll4r2nl dir dir-ltr&quot;&gt;We had an amazing  stay. The staff was very competent and made our stay fabulous. We will highly recommend this place to our family and friends.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;r1are2x1 dir dir-ltr&quot; data-review-id=&quot;659104431973950114&quot;&gt;&lt;div&gt;&lt;div class=&quot;chnzxuf c9gtck5 dir dir-ltr&quot;&gt;&lt;div class=&quot;t11wgnhd dir dir-ltr&quot; id=&quot;review_659104431973950114_title&quot;&gt;&lt;h3 tabindex=&quot;-1&quot; class=&quot;hghzvl1 dir dir-ltr&quot; elementtiming=&quot;LCP-target&quot;&gt;Prabir&lt;/h3&gt;&lt;div class=&quot;s15w4qkt dir dir-ltr&quot;&gt;&lt;div class=&quot;s189e1ab dir dir-ltr&quot;&gt;&lt;ol class=&quot;_7h1p0g&quot;&gt;&lt;li theme=&quot;[object Object]&quot; class=&quot;_1f1oir5&quot;&gt;June 2022&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;_e7hn5&quot; style=&quot;height: 40px; width: 40px;&quot;&gt;&lt;a target=&quot;_blank&quot; aria-label=&quot;Prabir&quot; href=&quot;/users/show/161248978&quot; class=&quot;_9bezani l1j9v1wn dir dir-ltr&quot;&gt;&lt;div class=&quot;_1c81x67&quot; style=&quot;height: 40px; width: 40px; border-radius: 50%;&quot;&gt;&lt;div class=&quot;dqra4ro bztshid dir dir-ltr&quot; role=&quot;img&quot; aria-busy=&quot;false&quot; aria-label=&quot;Prabir&quot; style=&quot;--dls-liteimage-height:100%; --dls-liteimage-width:100%; --dls-liteimage-background-image:url(&amp;quot;data:image/png;base64,null&amp;quot;); --dls-liteimage-background-size:cover;&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;div style=&quot;line-height: 24px;&quot;&gt;&lt;span&gt;&lt;span class=&quot;ll4r2nl dir dir-ltr&quot;&gt;We really enjoyed two days at this property. The villa as well as the entire property are well maintained. The view of lake as well as mountains are breathtaking. Very helpful care takers and food food.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/section&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;f1cwbdmm dir dir-ltr&quot; aria-hidden=&quot;true&quot; tabindex=&quot;0&quot;&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&#39;&#39;&#39;
page = BeautifulSoup(html, &#39;html.parser&#39;)
containers = page.select(&#39;[data-review-id] span.dir-ltr&#39;)
for container in containers:
print(container.text)
print(&#39;**********************************************&#39;)
Output:
This was a great find for us. Akash was our host for the stay. He was quite proactive in sharing with us instructions/information pertaining to the stay, followed-through diligently with the requisite actions, and was very responsive to the queries/additional-requests placed by us. Coming to the property itself - it&#39;s exactly as it looks in the pictures and perhaps prettier at this time of the year when there is a chill in the weather. The views from the living room and the 1st floor rooms are amazing. We couldnt try the pool owing to the chilly weather but it&#39;s kept quite clean and so is the garden area. It&#39;s around 40 mins drive from most of the to-visit places in/around nashik. The place is quite secure and the staff stays at the property.Coming to the people, Sonu and Shobha did their best to make us feel-at-home. Jeetendra was very keen to make this stay a foodie&#39;s delight with his expansive menu and the barbeque. And ofcourse we loved hanging out with Cocktail. Thank you all!!
**********************************************
We had an amazing  stay. The staff was very competent and made our stay fabulous. We will highly recommend this place to our family and friends.
**********************************************
We really enjoyed two days at this property. The villa as well as the entire property are well maintained. The view of lake as well as mountains are breathtaking. Very helpful care takers and food food.
**********************************************

huangapple
  • 本文由 发表于 2023年3月31日 20:32:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/75898563.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定