I m using python requests to search the following site: https://www.investing.com/ for the terms "Durable Goods Orders US"
I check in the "Network" tab of the inspect panel, and it seems it is simply done with the following form: 'quotes_search_text':'Durable Goods Orders US'
So I tried with python:
URL = 'https://www.investing.com/' data = {'quotes_search_text':'Durable Goods Orders US'} resp = requests.post(URL, data=data, headers={ 'User-Agent': 'Mozilla/5.0', 'X-Requested-With': 'XMLHttpRequest'}) However this doesnt return the result that i can see while doing it manually. All the search results should have "gs-title" as a class attribute (as per the page inspection) but when I do:
soup = BeautifulSoup(resp.text, 'html.parser') soup.select(".gs-title") I see no results... Is there some aspect of POST request that I am not taking into account? (im a complete noob here)
find_allselector is looking for a class attribute when it's expecting an HTML tag.<a class="gs-title" href="https://www.investing.com/economic-calendar/durable-goods-orders-86" target="_blank" dir="ltr" data-cturl="https://www.google.com/url?q=https://www.investing.com/economic-calendar/durable-goods-orders-86&sa=U&ved=0ahUKEwi28NG5tK7TAhWOa1AKHVhUBncQFggEMAA&client=internal-uds-cse&usg=AFQjCNEuRaJ1WI-VxrmeJ5VISPuraZ_Sug" data-ctorig="https://www.investing.com/economic-calendar/durable-goods-orders-86">United States <b>Durable Goods Orders</b> MoM</a>soup.find_all('a', {'class':'gs-title'})selectmethod.resp.textto manually search with ctrl-f in it, and I could see the correct page is not returned. So it's really with request that i need help.