1 回答

TA贡献1860条经验 获得超8个赞
我很抱歉。请忽略这个问题。我犯了一个小错误,将三重引用的注释放在代码另一部分的函数中。它禁用了有效传递的参数。
从下面删除三重引用评论后,我只得到英文结果:
for google_url in search(query, # The query you want to run
, # User interface language (host language)
num_results = 10, # Number of results per page
lr="lang_en" # Langauge of the documents received
'''
lr - parameter is implemented in __init__.py of googlesearch
It should be handled only here.
Other useful search parameters not used yet are:
cr - restricts search results to documents originating in a particular country.
(ex. cr=countryCA)
gl - boosts search results whose country of origin matches the parameter value.
(ex. gl=uk)
'''
):
添加回答
举报