我正在用python运行一些基本代码。 我正在使用https://pypi.org/project/play-scraper/播放器。
启动命令print(play_scraper.details('com.android.chrome'))时我会回来
AttributeError: 'NoneType' object has no attribute 'select'
我尝试调试该问题,问题似乎是它返回了一个空列表:
section_titles_divs = [x for x in soup.select('div.hAyfc div.BgcNfc')]
直到几周前,我正在接受如下内容:
{
'app_id': 'com.android.chrome',
'category': ['COMMUNICATION'],
'content_rating': ['Everyone'],
'current_version': 'Varies with device',
'description': 'Google Chrome is a fast, easy to use, and secure web browser. Designed for Android, Chrome brings you personalized news ...',
'description_html': 'Google Chrome is a fast, easy to ... Chrome web browser experience you love across all your devices.<br/> <br/> <b>Browse fast and type less.</b> ...',
'developer': 'Google LLC',
'developer_address': '1600 Amphitheatre Parkway, Mountain View 94043',
'developer_email': 'apps-help@google.com',
'developer_id': '5700313618786177705',
'developer_url': 'http://www.google.com/chrome/android',
'editors_choice': False,
'free': True,
'histogram': { 1: 672180, 2: 288519, 3: 735220, 4: 1560066, 5: 6033423},
'iap': False,
'iap_range': None,
'icon': 'https://lh3.googleusercontent.com/nYhPnY2I-e9rpqnid9u9aAODz4C04OycEGxqHG5vxFnA35OGmLMrrUmhM9eaHKJ7liB-',
'installs': '1,000,000,000+',
'interactive_elements': ['Unrestricted Internet'],
'price': '0',
'recent_changes': u"Thanks for choosing Chrome! You can now find your saved passwords more easily \u2013 just tap the new Search icon in Settings > Passwords. We've also included stability and performance improvements.",
'required_android_version': 'Varies with device',
'reviews': 9289408,
'score': '4.3',
'screenshots': [ 'https://lh3.googleusercontent.com/lKPDNfsO2QhJD9i77rGDTiH5ILjXlXwPsRi194hhkY4BsbaXbpCFrdjWvcU1zttUwqXz=w720-h310-rw', ...],
'size': 'Varies with device',
'title': 'Google Chrome: Fast & Secure',
'updated': 'May 10, 2018',
'url': 'https://play.google.com/store/apps/details?id=com.android.chrome',
'video': None
}
感谢您的帮助!
答案 0 :(得分:0)
今天早上我遇到了类似的问题。我在utils中进行了更改: Additional_info_data = parse_additional_info(soup.select_one('。IxB2fe'))
到
additional_info_data = parse_additional_info(soup.select_one('div.IxB2fe'))
该页面正在向上面的选择器加载两个引用,第一个结果是不正确的引用。我假设它曾经是只有一个结果要匹配的地方。
希望这会有所帮助!今天早上我很开心,这是肯定的。