Python / Selenium我得到错误,无法修复它

时间:2015-10-31 10:28:03

标签: python python-2.7

这是我的代码

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import Select
from selenium.common.exceptions import NoSuchElementException
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
import random

results = []
with open("al.txt") as inputfile:
   for line in inputfile:
       results.extend(line.strip().split(','))

x = random.choice(results)
driver = webdriver.Firefox()

while True:
    driver.get(x)
    element = driver.find_element_by_id("vB_Editor_QR_textarea")
    driver.implicitly_wait(10)
    element.send_keys("example")
    driver.implicitly_wait(60)
    driver.close()

我得到了

IndentationError: unexpected indent
PS C:\Users\asus\temp> python clickex1.py
  File "clickex1.py", line 24
    driver.implicitly_wait(60)

是否有可能安装了selenium,因此python不会读取库?

其他线路工作正常。我需要一些帮助,使用selenium和python,

脚本需要转到al.txt中的随机网站并在指定区域发布内容

0 个答案:

没有答案