Questions tagged [XPath] (139)

1
answer

How to get the last element?

How to obtain from this table the last Rating namely 12448 ( always is different ) Tried using xpath tree = html.fromstring(pars.content) stata = tree.xpath('//*[@id="bg"]/div[3]/div/div/div/div/div/div/div/div/div/table/tbody/tr[32]/td[3]') print(stata) but it is not working <table class="cntr wa mlra"> <tbody...
taryn_Franecki asked April 16th 20 at 11:14
1
answer

How to parse text xpath?

How to get nick ? (Igroman) using Xpath <div class="block_zero"><span class="white">1</span>. <img src="/images/icon/race/0.png" alt=""> <a href="/user/10550515/">Igroman</a><br>the power of the Titan: <img src="/images/icon/2hit.png" alt=""> <b>117304</b></div&...
myron87 asked April 9th 20 at 09:57
0
answer

Is it possible to write this shorter axle?

Good morning! Condition: to find a link only if it is around the image. Write the condition: self::a[descendant::img]. Question in order to improve the education: is it possible to write this condition in short? Thank you!
Aleen_Schmi asked April 8th 20 at 17:48
1
answer

Xpath syntax: strings, numbers, variables, functions?

Lord, there are clickable buttons on the website of the form: xpath("//button[contains(text(),'+5')]"), the numbers can be different. Is it possible instead to use a variable, or convert the string '+5' in the number to do click() on a button, for example provided >= +20? ps Put the question differently. Algorithm of act...
Irving.Haag asked April 8th 20 at 17:44
2
answers

PYTHON SELENIUM How to activate negligably element?

<a href="#" id="workButton0" style="margin-left: 7px;">CLICK</a> <a href="#" id="workButton1" style="margin-left: 7px; display: none;">CLICK</a> <a href="#" id="workButton2" style="margin-left: 7px;">CLOSE</a> There are such elements. The buttons change places once in a while. For examp...
helen.Quigley asked April 8th 20 at 01:50
3
answers

How to parse site elements generated by angularjs?

I want to parse the texts of tracks genius.com but there they are generated by JavaScript or something similar: type, first routable-page is ng-non-bindable (below command) - I think requests quickly takes what is gets, and then after a few seconds (apparently, that is loaded) to routable-page ng-non-bindable is replaced by...
isabella.DAmo asked April 7th 20 at 16:45
1
answer

How to make a xpath query in python?

r = s.get(url, headers=headers) tree = html.fromstring(r.text) our_path = f'//*[@data-id="{data_id}"]' a = tree.xpath(our_path) b = tree.xpath('//title/text()') When you get a b, then everything is OK, there is a conclusion of the text. in a response like this: [<Element tr at 0x16544a82590>, <InputElement 165...
stephanie_Walsh asked April 7th 20 at 11:33
2
answers

How to get from the DOM, all nodes with attribute attr starting from 'begin...'?

Hello! SUBJECT. Need to using xPath from the DOM, all nodes with the class clName and the attribute attr that begins c 'begin...' <tag class="clName" attr="begin1">...</tag> <tag class="clName" attr="begin2">...</tag> <tag class="clName" attr="begin3">...</tag> Specifically From the pa...
korey2 asked April 7th 20 at 09:42
0
answer

How to get a text and make comparisons,Selenium+Python?

Good evening! Please help to get the text of element to spend the assert: <div id="up_file_name" class="form-group has-error"> <label class="control-label">Error: invalid file format (permitted formats: doc, docx, pdf, txt, odt, rtf).</label> <input class="file" type="hidden" name="uploaded-file" val...
cristobal47 asked April 7th 20 at 09:38
1
answer

Xpath query how to write?

Dear arcane, Hello. Need your advice. You have the following html markup of the document:<html> the <head> </head> the <body> <div id="div1" class="div">Div1</div> <div id="div2" class="div">Div2</div> </body> </html> You need to write an xpath query that will fin...
Araceli.Kunde71 asked April 4th 20 at 12:55