โค้ด: เลือกทั้งหมด
driver.find_element_by_xpath("//input[@name=\"post\"]").click()
Moderator: mindphp, ผู้ดูแลกระดาน
โค้ด: เลือกทั้งหมด
driver.find_element_by_xpath("//input[@name=\"post\"]").click()
โค้ด: เลือกทั้งหมด
driver.find_element_by_xpath("//input[@name=\"post\"]").click()
โค้ด: เลือกทั้งหมด
Traceback (most recent call last):
File "/home/com010/m050/test2.py", line 37, in <module>
driver.find_element_by_xpath("//input[@name=\"post\"]").click()
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 77, in click
self._execute(Command.CLICK_ELEMENT)
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 493, in _execute
return self._parent.execute(command, params)
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 256, in execute
self.error_handler.check_response(response)
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
(Session info: chrome=61.0.3163.79)
(Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 4.10.0-33-generic x86_64)
โค้ด: เลือกทั้งหมด
browser.find_element_by_name("post").click()
โค้ด: เลือกทั้งหมด
browser.find_element_by_link_text(u"โพสต์").click()
โค้ด: เลือกทั้งหมด
driver.find_element_by_name("post").click()
โค้ด: เลือกทั้งหมด
Traceback (most recent call last):
File "/home/com010/m050/test2.py", line 37, in <module>
driver.find_element_by_name("post").click()
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 77, in click
self._execute(Command.CLICK_ELEMENT)
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 493, in _execute
return self._parent.execute(command, params)
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 256, in execute
self.error_handler.check_response(response)
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
(Session info: chrome=61.0.3163.79)
(Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 4.10.0-33-generic x86_64)
โค้ด: เลือกทั้งหมด
driver.find_element_by_link_text(u"โพสต์").click()
โค้ด: เลือกทั้งหมด
Traceback (most recent call last):
File "/home/com010/m050/test2.py", line 37, in <module>
driver.find_element_by_link_text(u"โพสต์").click()
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 77, in click
self._execute(Command.CLICK_ELEMENT)
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 493, in _execute
return self._parent.execute(command, params)
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 256, in execute
self.error_handler.check_response(response)
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Element is not clickable at point (973, 936)
(Session info: chrome=61.0.3163.79)
(Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 4.10.0-33-generic x86_64)
โค้ด: เลือกทั้งหมด
Traceback (most recent call last):
File "/home/com010/m050/test3.py", line 2, in <module>
driver = webdriver.Firefox()
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/firefox/webdriver.py", line 142, in __init__
self.service.start()
File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/common/service.py", line 81, in start
os.path.basename(self.path), self.start_error_message)
selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.
ตาม Errornatnicha001 เขียน:จากการใช้
มี error ดังนี้โค้ด: เลือกทั้งหมด
driver.find_element_by_xpath("//input[@name=\"post\"]").click()
โค้ด: เลือกทั้งหมด
Traceback (most recent call last): File "/home/com010/m050/test2.py", line 37, in <module> driver.find_element_by_xpath("//input[@name=\"post\"]").click() File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 77, in click self._execute(Command.CLICK_ELEMENT) File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py", line 493, in _execute return self._parent.execute(command, params) File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 256, in execute self.error_handler.check_response(response) File "/home/com010/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementNotVisibleException: Message: element not visible (Session info: chrome=61.0.3163.79) (Driver info: chromedriver=2.30.477691 (6ee44a7247c639c0703f291d320bdf05c1531b57),platform=Linux 4.10.0-33-generic x86_64)
โค้ด: เลือกทั้งหมด
time.sleep(5)
driver.assertTrue(driver.is_element_present(By.NAME, "post"))
โค้ด: เลือกทั้งหมด
Traceback (most recent call last):
File "/home/com010/m050/test2.py", line 39, in <module>
driver.assertTrue(driver.is_element_present(By.NAME, "post"))
AttributeError: 'WebDriver' object has no attribute 'assertTrue'
โค้ด: เลือกทั้งหมด
time.sleep(5)
driver.is_element_present(By.NAME, "post")
โค้ด: เลือกทั้งหมด
Traceback (most recent call last):
File "/home/com010/m050/test2.py", line 39, in <module>
driver.is_element_present(By.NAME, "post")
AttributeError: 'WebDriver' object has no attribute 'is_element_present'
สมาชิกกำลังดูบอร์ดนี้: ไม่มีสมาชิกใหม่ และบุคลทั่วไป 3