我正在使用for循環來通過站點的某些目錄進行爬網。 for url in URL_list:
for paged in range(1,99):
fullURL=("%s/?count=96&paged=%s&p=&page_id="%(url,paged))
print(fullURL)
source= urllib.request.urlope
我試圖找到標記中是否存在特定標題,如果標記中未包含該標題,請在t變量中打印文本。 到目前爲止,我可以拉標籤的整個「TD」有: for t in soup.findAll("td",{"class" : "someClass"}):
但是當我使用: title = "someTitle"
if title in t:
print "contains title"
else:
我一直在做一個刮板一段時間,現在已經非常接近讓它按預期運行。我的代碼如下: import urllib.request
from bs4 import BeautifulSoup
# Crawls main site to get a list of city URLs
def getCityLinks():
city_sauce = urllib.request.urlope
from urllib import request
from bs4 import BeautifulSoup as bs
#Used these libs
之間我需要存儲這兩個「文本」我將如何做到這一點的, <option value="/random-file/76/6/">Thing</option>
<option value="/random-file/36/6/">Thin