2017-07-15 143 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
)。執行此代碼後,我無法找到它。 –