python-scraping
python-scraping copied to clipboard
chapter13/4-dragAndDrop.py Doesn't work
debian 7
from selenium import webdriver from selenium.webdriver.remote.webelement import WebElement from selenium.webdriver import ActionChains
driver = webdriver.PhantomJS(executable_path='./phantomjs') driver.get('http://pythonscraping.com/pages/javascript/draggableDemo.html')
print(driver.find_element_by_id("message").text) Prove you are not a bot, by dragging the square from the blue area to the red area!
element = driver.find_element_by_id("draggable") target = driver.find_element_by_id("div2") actions = ActionChains(driver) actions.drag_and_drop(element, target).perform()
print(driver.find_element_by_id("message").text) Prove you are not a bot, by dragging the square from the blue area to the red area!
====== the same result saw at windows7 too!! and i found this https://github.com/SeleniumHQ/selenium/issues/2533
I came across the same question on a MAC. There is a solution in javascript http://elementalselenium.com/tips/39-drag-and-drop But I don't know how to solve it in Python 3
Other example work http://www.mahsumakbas.net/drag-and-drop-operation-in-selenium/