joelnazarene

main2

Apr 1st, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.48 KB | None | 0 0
  1. print("============================================================================================")
  2. print("\n")
  3.  
  4. print("======================================WELCOME TO ON POINT======================================================")
  5. from selenium import webdriver
  6. import time
  7. import bs4
  8. from bs4 import BeautifulSoup as soup
  9.  
  10. b1=input("enter the text to be searched\n")
  11. driver = webdriver.Firefox()
  12. #ieee explore===============================================================
  13. urlieee="https://ieeexplore.ieee.org/search/searchresult.jsp?newsearch=true&queryText="
  14. b2ieee=b1.replace(" ","%20")
  15. urlieee=urlieee+b2ieee
  16.  
  17.  
  18. driver.get(urlieee)
  19. time.sleep(5)
  20. refsieee=driver.page_source
  21. pagesoup=soup(refsieee,"html.parser")
  22. containersieee=pagesoup.findAll("div",{"class":"Dashboard-header col-12"})
  23.  
  24. countieee=containersieee[0].span.span.next_sibling.next_sibling.text
  25. #print(containers[0].span.span.next_sibling.next_sibling.text)
  26. #countieee = 0
  27. #sciencedirect==============================================================
  28.  
  29. urlsd="https://www.sciencedirect.com/search?qs="
  30. b3sd="&show=25&sortBy=relevance"
  31. b2sd=b1.replace(" ","%20")
  32. urlsd=urlsd+b2sd+b3sd
  33. time.sleep(2)
  34. driver.get(urlsd)
  35. refssd=driver.page_source
  36. pagesoup=soup(refssd,"html.parser")
  37. containersieee=pagesoup.findAll("div",{"class":"ResultsFound"})
  38.  
  39. countsd=containersieee[0].text
  40. #scienceopen=================================================================
  41.  
  42. urlso="https://www.scienceopen.com/search#('v'~3_'id'~''_'isExactMatch'~true_'context'~null_'kind'~77_'order'~0_'orderLowestFirst'~false_'query'~'"
  43. b2so=b1.replace(" ","%20")
  44. b3so="'_'filters'~!*)"
  45. urlso=urlso+b2so+b3so
  46. time.sleep(2)
  47. driver.get(urlso)
  48.  
  49. refsso=driver.page_source
  50.  
  51. pagesoup=soup(refsso,"html.parser")
  52. containers=pagesoup.findAll("div",{"class":'so-b3-label so--borderless so--gray-5 so--secondary'})
  53. #containers=pagesoup.findAll("a",{"href":re.compile('/document.*')})
  54. #print(containers[0].text)
  55. countso =containers[0].text
  56.  
  57.  
  58. #========================================================================================================================
  59. print("\n")
  60. print("\n")
  61.  
  62. print("============================================================================================")
  63. print("IEEE  "+ str(countieee)+" results")
  64. print("SCIENCE DIRECT   "+ str(countsd))
  65. print("SCIENCE OPEN    "+ str(countso))
  66.  
  67.  
  68.  
  69. driver.close()
  70. print("\n")
  71. print("============================================================================================")
Add Comment
Please, Sign In to add comment