Advertisement
Guest User

Untitled

a guest
May 10th, 2019
912
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
  2. Type "copyright", "credits" or "license()" for more information.
  3. >>> import requests
  4. >>> from bs4 import BeautifulSoup
  5. >>> bahammut_ranking_html=requests.get("https://www.gamer.com.tw/")
  6. >>> soup=BeautifulSoup(bahammut_ranking_html.text,"html.parser")
  7. >>> soup.find(class_="BA-ctag1").find(class_="BA-ctag1now").find(class_="BA-cbox BA cbox5 BA mobilegamechart").find(class_="game").find("p")
  8. Traceback (most recent call last):
  9. File "<pyshell#4>", line 1, in <module>
  10. soup.find(class_="BA-ctag1").find(class_="BA-ctag1now").find(class_="BA-cbox BA cbox5 BA mobilegamechart").find(class_="game").find("p")
  11. AttributeError: 'NoneType' object has no attribute 'find'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement