Get text inside a span class of a particular div

前端 未结 3 1040
-上瘾入骨i
-上瘾入骨i 2021-01-29 11:14

I am scraping the T-Mobile website for reviews on Samsung Galaxy S9. I am able to create a Beautiful Soup object for the HTML code, but I cannot fetch the text of reviews which

3条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-29 11:44

    first if you are using google chrome or mozilla firefox please press ctrl+u from the page, then you will go to the page source. Check if the review content is present anywhere in the source by searching some keywords. If present write the xpath of that data, if not present, check the network section for any json requests sending while the page loads, if not present you will have to use selenium.

    In your case send request to this page https://t-mobile.ugc.bazaarvoice.com/9060redes2-en_us/E4F08F7E-8C29-4420-BE87-9226A6C0509D/reviews.djs?format=embeddedhtml

    This is a json request send while loading the whole page.

提交回复
热议问题