duckduckgo

How to extract the text from the search results of duckduckgo using Selenium Python

五迷三道 提交于 2021-02-15 05:18:16
问题 I am trying to get the link descriptions of duckduck of search results using the following: results=browser.find_elements_by_xpath("//div[@id='links']/div/div/div[2]") description=[] for result in results: description.append(result.text) I am getting the error 'list' object has no attribute 'text'. I was able to use a similar method to get the search result titles, but for some reason I am unable to extract the text from this particular xpath. 回答1: To extract the link descriptions of the

How to extract the text from the search results of duckduckgo using Selenium Python

随声附和 提交于 2021-02-15 05:17:36
问题 I am trying to get the link descriptions of duckduck of search results using the following: results=browser.find_elements_by_xpath("//div[@id='links']/div/div/div[2]") description=[] for result in results: description.append(result.text) I am getting the error 'list' object has no attribute 'text'. I was able to use a similar method to get the search result titles, but for some reason I am unable to extract the text from this particular xpath. 回答1: To extract the link descriptions of the

How to extract the text from the search results of duckduckgo using Selenium Python

﹥>﹥吖頭↗ 提交于 2021-02-05 08:09:12
问题 I am trying to get the link descriptions of duckduck of search results using the following: results=browser.find_elements_by_xpath("//div[@id='links']/div/div/div[2]") description=[] for result in results: description.append(result.text) I am getting the error 'list' object has no attribute 'text'. I was able to use a similar method to get the search result titles, but for some reason I am unable to extract the text from this particular xpath. 回答1: To extract the link descriptions of the

Get response 200 instead of <418 I'm a Teapot>, using DDG

為{幸葍}努か 提交于 2021-01-28 13:33:56
问题 I was trying to scrape search results from DDG the other day, but i keep getting response 418. How can i make it response 200 or get results from it? This is my code. import requests from bs4 import BeautifulSoup import urllib while True: query = input("Enter Search Text: ") a = query.replace(' ', '+') url = 'https://duckduckgo.com/?q=random' +a headers = {"User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; SHIELD Tablet K1 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0

Get response 200 instead of <418 I'm a Teapot>, using DDG

那年仲夏 提交于 2021-01-28 13:32:15
问题 I was trying to scrape search results from DDG the other day, but i keep getting response 418. How can i make it response 200 or get results from it? This is my code. import requests from bs4 import BeautifulSoup import urllib while True: query = input("Enter Search Text: ") a = query.replace(' ', '+') url = 'https://duckduckgo.com/?q=random' +a headers = {"User-Agent": "Mozilla/5.0 (Linux; Android 6.0.1; SHIELD Tablet K1 Build/MRA58K; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0