Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/278.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用selenium和python在LinkedIn组中发布图像?_Python_Selenium_Web Scraping_Linkedin_Browser Automation - Fatal编程技术网

如何使用selenium和python在LinkedIn组中发布图像?

如何使用selenium和python在LinkedIn组中发布图像?,python,selenium,web-scraping,linkedin,browser-automation,Python,Selenium,Web Scraping,Linkedin,Browser Automation,我正在尝试使用selenium和python在LinkedIn组中发布图像。到目前为止,我只能发布测试。我试图将图像上载到,但图像被跳过。我也没有得到一些错误,只有文字发布 这里是到的链接 def postImageInGroup(driver, group_url, title, body, image): driver.get(group_url) WebDriverWait(driver, 100) driver.find_element_by_name('ti

我正在尝试使用selenium和python在LinkedIn组中发布图像。到目前为止,我只能发布测试。我试图将图像上载到,但图像被跳过。我也没有得到一些错误,只有文字发布

这里是到的链接

def postImageInGroup(driver, group_url, title, body, image):
    driver.get(group_url)

    WebDriverWait(driver, 100)

    driver.find_element_by_name('title').click()
    WebDriverWait(driver, 100)

    driver.find_element_by_name('title').send_keys(title)
    driver.find_element_by_name('body').send_keys(body)

    driver.execute_script("window.scrollTo(0, document.body.scrollHeight/2);")
    WebDriverWait(driver, 200)

    driver.find_element_by_name('file_upload').send_keys(Keys.DELETE)
    driver.find_element_by_name('file_upload').send_keys(image)

    driver.implicitly_wait(20)
    WebDriverWait(driver, 200).until(EC.presence_of_element_located((By.CLASS_NAME, 'action-submit')))
    driver.find_element_by_class_name('action-submit').click()