2017-07-15 117 views
-3

https://plus.google.com/s/casasgrandes27%40gmail.com/top与蟒蛇

我需要抓取与蟒蛇以下页面,但我需要它的HTML链接没有的通用源代码爬行后如何获得的HTML代码。

例如

打开链接:plus.google.com/s/casasgrandes27%40gmail.com/top而不登录第二最后一个缩略图将“G套件”。

<div class="Wbuh5e" jsname="r4nke">G Suite</div> 

执行此python代码后,我无法找到上述的HTML代码行。

from bs4 import BeautifulSoup 
import requests 

L = list() 
r = requests.get("https://plus.google.com/s/casasgrandes27%40gmail.com/top") 
data = r.text 
soup = BeautifulSoup(data,"lxml") 

print(soup) 
+0

我使用BeautifulSoup要抓取页面,请参阅上面的代码。 –

回答

0

你可以试试这个代码读取HTML页面:

import urllib.request 

urls = "https://plus.google.com/s/casasgrandes27%40gmail.com/top" 
html_file = urllib.request.urlopen(urls) 
html_text = html_file.read() 
html_text = str(html_text) 
print(html_text) 
+0

没有工作页面内容,请打开链接:https://plus.google.com/s/casasgrandes27%40gmail.com/top无需登录,第二个缩略图将是G Suite(

G Suite
)。执行此代码后,我无法找到它。 –