#-*- coding: UTF-8 -*- #!/usr/bin/env python print("test - 1") import sys from selenium import webdriver print("test - 2") url = "http://XXX.com/" driver = webdriver.Firefox() driver.get(url+ "/") driver.find_element_by_xpath("//div[2]/input").send_keys("XXX") driver.find_element_by_xpath("//div[3]/input").send_keys("XXX") driver.find_element_by_id("loginButton").click() driver.find_element_by_css_selector("a > img").click() driver.quit()
代码如上图
crontab 配置:
export DISPLAY=:0.0 && python /Users/l/Downloads/phantomjs-2.1.1-macosx/bin/release-day/test.py >> /Users/l/Downloads/log
输出结果为:
test - 1
请教是什么问题?解决方案是什么?
付费偷看金额在0.1-10元之间
一周热门 更多>