Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("============================================================================================")
- print("\n")
- print("======================================WELCOME TO ON POINT======================================================")
- from selenium import webdriver
- import time
- import bs4
- from bs4 import BeautifulSoup as soup
- b1=input("enter the text to be searched\n")
- driver = webdriver.Firefox()
- #ieee explore===============================================================
- urlieee="https://ieeexplore.ieee.org/search/searchresult.jsp?newsearch=true&queryText="
- b2ieee=b1.replace(" ","%20")
- urlieee=urlieee+b2ieee
- driver.get(urlieee)
- time.sleep(5)
- refsieee=driver.page_source
- pagesoup=soup(refsieee,"html.parser")
- containersieee=pagesoup.findAll("div",{"class":"Dashboard-header col-12"})
- countieee=containersieee[0].span.span.next_sibling.next_sibling.text
- #print(containers[0].span.span.next_sibling.next_sibling.text)
- #countieee = 0
- #sciencedirect==============================================================
- urlsd="https://www.sciencedirect.com/search?qs="
- b3sd="&show=25&sortBy=relevance"
- b2sd=b1.replace(" ","%20")
- urlsd=urlsd+b2sd+b3sd
- time.sleep(2)
- driver.get(urlsd)
- refssd=driver.page_source
- pagesoup=soup(refssd,"html.parser")
- containersieee=pagesoup.findAll("div",{"class":"ResultsFound"})
- countsd=containersieee[0].text
- #scienceopen=================================================================
- urlso="https://www.scienceopen.com/search#('v'~3_'id'~''_'isExactMatch'~true_'context'~null_'kind'~77_'order'~0_'orderLowestFirst'~false_'query'~'"
- b2so=b1.replace(" ","%20")
- b3so="'_'filters'~!*)"
- urlso=urlso+b2so+b3so
- time.sleep(2)
- driver.get(urlso)
- refsso=driver.page_source
- pagesoup=soup(refsso,"html.parser")
- containers=pagesoup.findAll("div",{"class":'so-b3-label so--borderless so--gray-5 so--secondary'})
- #containers=pagesoup.findAll("a",{"href":re.compile('/document.*')})
- #print(containers[0].text)
- countso =containers[0].text
- #========================================================================================================================
- print("\n")
- print("\n")
- print("============================================================================================")
- print("IEEE "+ str(countieee)+" results")
- print("SCIENCE DIRECT "+ str(countsd))
- print("SCIENCE OPEN "+ str(countso))
- driver.close()
- print("\n")
- print("============================================================================================")
Add Comment
Please, Sign In to add comment