Chrome dirver crawling_1_modified (add url)

Asked 1 years ago, Updated 1 years ago, 97 views

url ='https://play.google.com/store/apps/details?id=tools.photo.hd.camera&hl=en'

title = driver.find_element_by_xpath('//title')

print(title.get_attribute('content'))

None is the result of this code. I can't find anything.

    url ="'https://play.google.com/store/apps/details?id=tools.photo.hd.camera&hl=en'"
    driver.get(url)
    page = driver.page_source

    soup = BeautifulSoup(page, "html.parser")

    table = soup.find("div", class_="id-app-title")

    print("App name: ", table.string)

AttributeError: 'NoneType' object has no attribute 'string' I changed the code a little bit using requrests

page = requests.get(url).text
soup = BeautifulSoup(page, "html.parser")
table = soup.find("div", class_="id-app-title")

print("App name: ", table)

So when I picked the results, App name: None "T" Why haven't I been able to print out the content? In the past, when I did it through human API, I picked it well if I matched the name of the div class, but in Google Play Store, even if I matched the name of the div class, I got a none value ㅠㅜ

python crawling chromedriver xpath

2022-09-22 12:29

1 Answers

Looking closely, the class value is fixed.

import requests
import bs4

contents = requests.get('https://play.google.com/store/apps/details?id=tools.photo.hd.camera&hl=en').content
bs = bs4.BeautifulSoup(contents, 'html.parser')

text = bs.find('div', attrs={'jsname':"sngebd"})

print(text)

<div jsname="sngebd">HD camera lets you easily shoot HD photos and videos, and offers beautiful filters, and panorama photo mode! 🎊🎉💯<br/><br/>📷 <b>Features:</b><br/>* Optical / digital zoom, tap to focus, focus halo display<br/>* AF mode (infinity, Macro )<br/>* White Balance ( Auto, Fluorescent, white, daylight, cloudy )<br/>* Countdown pictures<br/>* Set the photo size<br/>* Record the shooting location information<br/>*Adjust exposure<br/>* View mode ( sports, night, sunset, party )<br/>*The front and the rear camera toggle<br/>* Shoot and produce a panoramic photo, take immersive panorama<br/>* Viewfinder display sensor can capture the full screen, and not crop the image<br/>* Panorama mode requires the use of a gyro sensor<br/>* For Android 4.0 and higher versions of phones and tablets<br/><br/>------------------<br/>💎 <b>Disclaimer:</b><br/>This app is based on native android camera code and licensed under the Apache License.<br/>Apache Licens: http://www.apache.org/licenses/LICENSE-2.0.html</div>


2022-09-22 12:29

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.