Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
stop cycle while
#1
Hello people, I dont know how to stop/pass this cycle while.
the situation is the next:
In one web page I need to click few times until reload the next page.

the problem is when go for the next webpage, i dont know why, but the python dont go out from the cycle while, and of course he can´t find the "find_element_by_xpath(f[i])" and have a error in "element1=driver.find_element_by_xpath(f[i])" because I can´t find the xpath


while True :
			try:

				element1=driver.find_element_by_xpath(f[i])
				driver.find_element_by_xpath(f[i]).click()
				import time
				time.sleep(1)
			except ValueError:
				print("no more clicks")

			pass
Reply


Messages In This Thread
stop cycle while - by windows11 - May-16-2020, 02:42 PM
RE: stop cycle while - by deanhystad - May-16-2020, 03:17 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Need to fix SyntaxError in cycle try alexfrol86 14 3,230 Mar-27-2022, 07:53 AM
Last Post: stevendaprano
  Trying to cycle through a list of charcters pooky2483 12 4,512 Sep-28-2020, 06:55 AM
Last Post: pooky2483
  <while> cycle is not interrupted when using the <random>module ShityCoder 3 2,176 Sep-04-2020, 04:05 PM
Last Post: ShityCoder
  Cycle of numpy variables Zero01 0 1,565 Jul-31-2020, 11:58 AM
Last Post: Zero01
  Occurrences using FOR and IF cycle P86 2 2,540 Jul-29-2019, 04:37 PM
Last Post: ThomasL
  pool map cycle skorost5 5 3,845 Apr-07-2019, 09:21 AM
Last Post: skorost5
  lifetime cycle counter Ixxxxxx 0 2,497 Mar-07-2018, 07:26 PM
Last Post: Ixxxxxx

Forum Jump:

User Panel Messages

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