0
import.java.util.ArrayList;
import csv
import pynput
import.java.util.ArrayList;


from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
from array import array
from pynput.keyboard import Key ,Controller
from selenium.webdriver.common.keys import Keys
Keyboard = Controller()






def csv_url_reader(url_obj):
   reader =  csv.DictReader(url_obj,delimiter = ',')

   for line in reader:
       url = line["URL"]
       title = line["Title"]
       print  (url+title)
       driver = webdriver.Chrome(r'C:\Users\Administrator\Downloads\chromedriver_win32\chromedriver')
       act = ActionChains(driver)
       driver.get(url)
       driver.find_element_by_name("q")

        #driver.find_element(by.cssSelector("body")).sendKeys(Keys.CONTROL + 't');

       Keyboard.type("projectpython")
       driver.execute_script("window.open('');")  # opens new tab
        tabs2 = driver.windows_handles
       driver.switch_to().window(tabs2.get(1))



       act.send_keys(Keys.CONTROL).send_keys('a')

       assert title in driver.title

我试图导入 Arraylist 但我在 java 上得到一个红色标记

我尝试使用 pip install import-java 安装 java,但出现此错误

命令“python setup.py egg_info”失败,错误代码为 1

我已经尝试了一切,但我无法成功请帮助我解决这个问题

4

0 回答 0