- get titles of topics from wikipedia
- automation of google page details
This function prints the titles of possible wiki topics:
queries= ["CPU", "GPU", "RAM", "SSD", "HDD", "SingleShot", "MultiShot", "AutoFocus", "Aperture", "ISO", "ShutterSpeed"]
id="#firstHeading"wiki_url="https://en.wikipedia.org/wiki/"results=asyncio.run(get_Titles(queries, id, wiki_url))
pprint(results)This function automates the soup of any number of pages:
url, query, page_id, google_search_btn_id="https://www.google.com", "kung fu panda", "(//h3)[1]", "btnK"results=get_insider_page_details(url, query, page_id, google_search_btn_id)
pprint(results)url="https://www.google.com"query="kung fu panda"page_id="(//h3)"google_search_btn_id=f'//*[@name="btnK"]'page_size=10next_button_id='//span[normalize-space()="Next"]'stop_page=14query_id='//*[@name="q"]'results=automate_google_query(url,query_id, query, page_id, google_search_btn_id, page_size, next_button_id, stop_page)
pprint(results)