Python Forum
How to click the button automatically using python
Thread Rating:
  • 1 Vote(s) - 2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to click the button automatically using python
#21
Hi Nilamo,
You were right there was some dynamic parts which were getting uploaded later on.

I was stuck on this issue from last 5 days. Thank you so much, at-least now I can move forward and do what I actually I want to do.


One last thing after adding time it is returning element and when I printing the result it is is giving below mentioned output
Output:
DevTools listening on ws://127.0.0.1:12985/devtools/browser/544d17ad-2741-48d2-ad29-6e1e4825f09b sleep start sleep end <selenium.webdriver.remote.webelement.WebElement (session="8884bd8733422e9333cf859dab06bbf2", element="0.4768278162076718-1")>
what is meaning of last line in output
Reply
#22
You printed the element.  That's the element.  Or, at least, Selenium's representation of the element.
Reply
#23
(Dec-07-2017, 04:58 AM)purnima1 Wrote: One last thing after adding time it is returning element and when I printing the result it is is giving below mentioned output
That element has many methods.
Example the html:
<input name="EMAIL" size="24" maxlength="75" type="text">
Find it bye CSS:
email = browser.find_element_by_css_selector('#SubID > input[type="text"]')
Test:
>>> email
<selenium.webdriver.firefox.webelement.FirefoxWebElement (session="845a65d9-e7a7-4c17-9cdf-3086ac17d464", element="{f2f383ec-bc7a-461a-a84e-fab5a4bfcd04}")>
>>> email.tag_name
'input'
>>> email.send_keys('Foo')
So here using 2 method tag_name and send_keys which will send Foo to the input field in browser. 
​​​A good editor or REPL will show you all method that can be used,or can use dir(email).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  cant click button by script at page michael1834 1 995 Dec-08-2023, 04:44 PM
Last Post: SpongeB0B
  Click on a button on web page using Selenium Pavel_47 7 4,564 Jan-05-2023, 04:20 AM
Last Post: ellapurnellrt
  Show HTML in Python application and handle click SamHobbs 2 2,662 Sep-28-2021, 06:27 PM
Last Post: SamHobbs
  button click error rafarangel 2 3,082 Feb-11-2021, 08:19 PM
Last Post: buran
  Log In Button Won't Click - Python Selenium Webdriver samlee916 2 3,770 Jun-07-2020, 04:42 PM
Last Post: samlee916
  How to click facebook message button JanelleGuthrie 2 2,370 May-14-2020, 06:02 PM
Last Post: Larz60+
  Contact form button click action Man_from_India 1 2,748 Feb-01-2020, 06:21 PM
Last Post: snippsat
  HOWTO? Login DSL Modem with Python Requests: need Click "Apply" Button Webtest 4 8,406 Aug-20-2019, 04:03 PM
Last Post: johnmina
  Selenium click on popup button??? GuJu 7 7,727 Jul-20-2019, 09:21 AM
Last Post: Nizam
  How to trigger click event on Button without ID/Name gahhon 7 13,796 Feb-10-2019, 03:06 PM
Last Post: gahhon

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020