我正在尝试在python环境中集成LDTP和selenium,以便自动将图像上传到" http://imgure.com/"
我的环境如下:
LDTP:v3.5
from selenium import webdriver
import ldtp
def main():
browser = webdriver.Firefox()
browser.implicitly_wait(5000)
browser.get("http://imgur.com/")
browser.maximize_window()
browser.find_element_by_css_selector("li.upload-button-container").click()
browser.find_element_by_css_selector("div#upload-global-file-wrapper").click()
ldtp.maximizewindow("File Upload")
#Call LDTP's mouserightclick function
ldtp.mouseleftclick('File Upload', 'btnOpen')
browser.find_element_by_css_selector("button#upload-global-start-button.button-big.green").click()
if __name__ == '__main__':
main()
我的Pycram截图: