标题和那些斜杠是什么意思

时间:2019-05-27 06:29:30

标签: python python-2.7

我正在用python做一个项目。我在网上找到了此代码,并卡在标题行中。

elif(emotion == "Surprise"): 
    urlhere = 'http://www.imdb.com/search/title?genres=film_noir&title_type=feature&sort=moviemeter, asc'

# HTTP request to get the data of 
# the whole page 
response = HTTP.get(urlhere) 
data = response.text 

# Parsing the data using 
# BeautifulSoup 
soup = SOUP(data, "lxml") 

# Extract movie titles from the 
# data using regex 
title = soup.find_all("a", attrs = {"href" : re.compile(r'\/title\/tt+\d*\/')}) 
return title 

不确定标题和反斜杠在做什么以及目的是什么。我知道find_all可以做什么,但是re.compile有点令人困惑

0 个答案:

没有答案