重要的是不要顯示整個 URL,而可能只顯示“到文章”,以便存放“到文章”后面的 URL?
googlenews = GoogleNews()
googlenews.set_encode('utf_8')
for ort in orte:
googlenews.clear()
googlenews.get_news(ort)
table_new = []
for row in googlenews.results():
table_new.append({
'City': ort,
'Title': row['title'],
'Date': row['date']})
df = pd.DataFrame(table_new)
nachrichten.append(df)
dfges = pd.concat(nachrichten, axis='index')
print(dfges)
′′′
uj5u.com熱心網友回復:
您的原始 URL 無效。要將它們轉換為您想要添加row['link'].replace('/./article', '/article')的有效 Google 新聞 URL 并添加https://前綴。獲取真實鏈接的選項已在
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/458945.html
上一篇:避免URL引數操作
下一篇:DayJS歷史日期格式問題
