Guest User

Untitled

a guest
Jan 18th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. from googlesearch import search
  2. import urllib.request as urllib
  3. from bs4 import BeautifulSoup
  4. from detective import Analyzer as Detective
  5. import sys
  6. from PyQt5 import QtCore, QtGui, QtWidgets
  7. from PyQt5.QtWidgets import QApplication, QMainWindow
  8. from design import Ui_Lartzer
  9. from PyQt5.QtCore import pyqtSlot
  10.  
  11.  
  12. class AdvancedSearch:
  13. def __init__(self):
  14. self.urls = []
  15. self.titles = []
  16.  
  17. def google_scrape(self, url):
  18. thepage = urllib.urlopen(url)
  19. soup = BeautifulSoup(thepage, "html.parser")
  20. self.urls.append(url)
  21. self.titles.append(soup.title.text)
  22. return soup.title.text
  23.  
  24.  
  25. class Run(Ui_Lartzer):
  26. def __init__(self, dialog):
  27. Ui_Lartzer.__init__(self)
  28. self.setupUi(dialog)
  29.  
  30. # Connect "add" button with a custom function (addInputTextToListbox)
  31. self.search.clicked.connect(self.searchInfo)
  32.  
  33. # @pyqtSlot()
  34. def searchInfo(self):
  35. print("oof")
  36.  
  37.  
  38. if __name__ == '__main__':
  39. app = QtWidgets.QApplication(sys.argv)
  40. window = QMainWindow()
  41. dialog = QtWidgets.QDialog()
  42.  
  43. prog = Run(window)
  44.  
  45. ui = Ui_Lartzer()
  46. ui.setupUi(window)
  47.  
  48. window.show()
  49. sys.exit(app.exec_())
Add Comment
Please, Sign In to add comment