我正在创建一个python应用程序。
链接到 ui.py 和 app.py: https://gist.github.com/tbhaxor/f68387d49bc59b2bdd025512c17a2534
app.py
from PyQt5 import QtWidgets, QtCore
from ui import Ui_MainWindow
from selenium.webdriver.chrome.webdriver import WebDriver
from selenium.webdriver.chrome.options import Options
import os
import traceback
import pickle as pkl
from pathlib import Path
from typing import List, Dict, Union
class Application(Ui_MainWindow):
def __init__(self,
window: QtWidgets.QMainWindow,
driver: WebDriver = None):
self.parent = window
self.driver = driver
self.setupUi(window)
self.retranslateUi(window)
qtRectangle = window.frameGeometry()
centerPoint = QtWidgets.QDesktopWidget().availableGeometry().center()
qtRectangle.moveCenter(centerPoint)
window.move(qtRectangle.topLeft())
self.__makeHandlers()
self.file = os.path.join(Path.home(), "_linkedin.db")
self.db: Dict[str, str] = {
"api": "",
"email": "",
"password": "",
"sent": [],
"delay": 10,
"template": ""
}
self.search_limit.valueChanged.connect(print)
pass
def __makeHandlers(self):
self.search_limit.valueChanged.connect(print)
pass
def handle_fetch(self):
pass
def __login(self):
driver.get("https://www.linkedin.com/login")
# /html/body/div[1]/main/div/form/div[1]/input
# /html/body/div[1]/main/div/form/div[2]/input
# /html/body/div[1]/main/div/form/div[4]/button
pass
pass
if __name__ == "__main__":
import sys
try:
opts = Options()
opts.headless = os.environ.get("PYDBG", "0") != "1"
driver: WebDriver = WebDriver(options=opts)
app = QtWidgets.QApplication(sys.argv)
牛魔王的故事
相关分类