class MaruCrawler(QWidget):
def __init__(self):
super().__init__()
self.dir_path = "./"
self.driver = webdriver.Chrome('Chrome/chromedriver.exe')
self.URL = None
self.initUI()
def initUI(self):
self.setWindowTitle('MaruCrawler')
self.url_input = QLineEdit(self)
self.url_input.returnPressed.connect(self.inputChanged)
self.url_input.resize(300,20)
self.btn = QPushButton(self)
self.btn.clicked.connect(self.inputChanged)
self.btn.move(70,70)
self.pbar = QProgressBar(self)
self.pbar.resize(200,30)
self.pbar.move(100,100)
self.move(300, 300)
self.resize(400, 200)
self.show()
def inputChanged(self):
self.pbar.setMaximum(0)
self.URL = self.url_input.text()
self.btn.setEnabled(False)
self.url_input.setEnabled(False)
self.pbar.setMaximum(0)
self.crw = ThreadCrawler(parent=self)
self.crw.start()
self.crw.finished.connect(self.crawl_finish)
@pyqtSlot(int)
def crawl_finish(self, value):
print(value)
if value == 1:
QMessageBox.information(self, 'Message', 'Finish')
elif value == 2:
QMessageBox.information(self, 'Message', 'Error')
self.btn.setEnabled(True)
self.url_input.setEnabled(True)
self.url_input.clear()
self.pbar.reset()
i made image crawling GUI but the problem is that when i add
self.pbar.setMaximum(0)
in def inputChanged when loading crawling thread, the program crash with 0xC0000005 code
if i rip this code, code works well....
User contributions licensed under CC BY-SA 3.0