2017-08-07 78 views

回答

2

您可以下載這樣

import urllib2 
response = urllib2.urlopen('http://www.example.com/file_to_download') 
html = response.read() 

文件,以獲取所有的頁面

from bs4 import BeautifulSoup 

import requests 
r = requests.get("http://site-to.crawl") 
data = r.text 
soup = BeautifulSoup(data) 

for link in soup.find_all('a'): 
    print(link.get('href')) 
+0

感謝@naren做。它的工作完美:) – Bharath

0

你可以做到這一點的聯繫方式有兩種1.by代碼2.by software

1.by code

使用Web Scrapper類庫如BeautifulSoup,JSoup

如果它不起作用,或者您需要執行點擊按鈕,那麼您可以使用Selenium。

2.by軟件

使用互聯網下載管理器的抓取功能這個

+0

感謝您的回答 – Bharath