Skip to content

Instantly share code, notes, and snippets.

View HarishGargIndia's full-sized avatar

HarishGargIndia

View GitHub Profile
@HarishGargIndia
HarishGargIndia / gist:3e7dca8332de93406b31ceb23a36b00b
Created October 15, 2017 11:17
id in xpath is getting changed every time in selenium pyhton2.7 chrome
HTML Code is ..
*<div class="N1LCMI-ib-e" role="option" id="gwt-uid-2423" style="user-select: none;">Hotel ID</div>
*there is one button when i click on it there are some categories to select Only one category can be selected in one time. So Id in xpath is getting changed every time when i am using Xpath of that category. below is code which i am using to select that category.
driver.find_element_by_xpath('//*[@id="gwt-uid-2423"]').click() #select Hotel ID
so only 2423 part is getting changed every time.
is there any other way to go for it. pls help....