xpath

how to replace \n to <br > in telegram instant view

巧了我就是萌 提交于 2020-04-19 18:50:13
问题 I am trying to setup a Telegram Instant View for a website. i have a text with a lot of break-lines \n and no <br> so i need a solution to replace every \n to <br> 回答1: Try @replace function: @replace("\\n", "<br>"): $body//p 回答2: There is no way (in the Instant View DSL) to replace a part of a text node with an HTML tag (i.e. element node). Any HTML you insert as text will be escaped. 回答3: As I remember, if you debug $paragraph/text() , there will be a lot of text nodes, that are separated

How to take preceding element when iterating over XML in Python?

三世轮回 提交于 2020-04-18 06:10:15
问题 I have an XML structured like this: <?xml version="1.0" encoding="utf-8"?> <pages> <page id="1" bbox="0.000,0.000,462.047,680.315" rotate="0"> <textbox id="0" bbox="179.739,592.028,261.007,604.510"> <textline bbox="179.739,592.028,261.007,604.510"> <text font="NUMPTY+ImprintMTnum" bbox="191.745,592.218,199.339,603.578" ncolour="0" size="12.482">C</text> <text font="NUMPTY+ImprintMTnum-it" bbox="191.745,592.218,199.339,603.578" ncolour="0" size="12.333">A</text> <text font="NUMPTY+ImprintMTnum

how do we join in XPATH using version 1.0?

久未见 提交于 2020-04-18 06:10:13
问题 I'm trying to get the lN and the names of a person and the price of a car rental which is > 300 below is my XML example: <rent number="101111"> <car> <startDate>2018-02-08</startDate> <endDate>2018-03-05</endDate> <Location>Toranto</Location> <carType>BMW</carType> <transmissionType>Automatic</transmissionType> </car> <person> <licenseNumber> 02389749372 </licenseNumber> <name>Alexa Steve</name> <dob>1999-03-01</dob> <phone> <type>Home</type> <number>44 010 1111 4567</number> </phone> <email>

How to specify Xpath that return whole table without last row?

半世苍凉 提交于 2020-04-18 05:48:26
问题 Here is the code of a table. I need to extract whole table without last row. Whole table: <table class="product-content__table"> <tr><th class="product-content__th">Состав</th><td>нержавеющая сталь, натуральная кожа </td></tr> <tr><th class="product-content__th">Ширина</th><td>2 см</td></tr><tr><th class="product-content__th">Цвет</th><td>серый </td></tr> <tr><th class="product-content__th">Страна производства</th><td>Россия </td></tr><tr><th class="product-content__th">Сезон</th><td>Мульти <

Selenium not finding element by XPath (although visible in browser)

徘徊边缘 提交于 2020-04-18 05:46:27
问题 So I'm trying to get the left bar of this website: https://experience.arcgis.com/experience/685d0ace521648f8a5beeeee1b9125cd to get the current WHO coronavirus data. I'm locating the countries by Xpath, my code is: from selenium import webdriver import time driver = webdriver.Firefox() driver.get("link_to_the_page") time.sleep(30) countries = country = "/html/body/div/div/div[2]/div/div/div/margin-container/full-container/div[10]/margin-container/full-container/div/div[2]/nav/span/div/div/p

Use Xpath to get all the rows of a table after a specific row in Automation Anywhere

心不动则不痛 提交于 2020-04-18 05:10:55
问题 I am trying to get the values of all the row after a specific row(This specific row can be identified using id) using xpath. Kindly note that i am using it in automation anywhere's object cloning command to locate and fetch the details. lets say this is the table: <table class="actiontable" > <tbody> <tr></tr> <tr></tr> <tr id="h32423"> <td class="claim"><span id="claimants">Claimants</span></td> </tr> <tr id="a23"> <td id="g543"><a href="some site">Edward Hunter</a> </td> </tr> <tr> <td id=

How to import table with mix of text and image metadata with IMPORTHTML and/or IMPORTXML?

五迷三道 提交于 2020-04-18 03:47:31
问题 I'm trying to import tables with a mixture of text and images into Google Sheets with IMPORTHTML and/or IMPORTXML function. The tables I'm trying to import are the 'Equipment' tables under the 'Advancement' section from multiple sites like this: https://stt.wiki/wiki/Xindi_%27Prisoner%27_Archer. The number of stars at each item in the table represents a "level" from 1 ("Common") to 5 ("Legendary"), with no stars representing level 0 ("Basic"). The image metadata contains the level description

How to import table with mix of text and image metadata with IMPORTHTML and/or IMPORTXML?

社会主义新天地 提交于 2020-04-18 03:47:23
问题 I'm trying to import tables with a mixture of text and images into Google Sheets with IMPORTHTML and/or IMPORTXML function. The tables I'm trying to import are the 'Equipment' tables under the 'Advancement' section from multiple sites like this: https://stt.wiki/wiki/Xindi_%27Prisoner%27_Archer. The number of stars at each item in the table represents a "level" from 1 ("Common") to 5 ("Legendary"), with no stars representing level 0 ("Basic"). The image metadata contains the level description

How do we get the Longest Booking in XPATH 1.0?

夙愿已清 提交于 2020-04-17 20:20:25
问题 How can I get the name of the person who has the longest Booking using the attribute StartDate and EndDate belwo i menioned the xml dummy data i have like 12 diffrent datas and more people , the version i am using for xpath is 1.0 <rent number="101111"> <car> <startDate>2018-02-08</startDate> <endDate>2018-03-05</endDate> <Location>Toranto</Location> <carType>BMW</carType> <transmissionType>Automatic</transmissionType> </car> <person> <licenseNumber> 02389749372 </licenseNumber> <name>Alexa

How do we get the Longest Booking in XPATH 1.0?

瘦欲@ 提交于 2020-04-17 20:17:45
问题 How can I get the name of the person who has the longest Booking using the attribute StartDate and EndDate belwo i menioned the xml dummy data i have like 12 diffrent datas and more people , the version i am using for xpath is 1.0 <rent number="101111"> <car> <startDate>2018-02-08</startDate> <endDate>2018-03-05</endDate> <Location>Toranto</Location> <carType>BMW</carType> <transmissionType>Automatic</transmissionType> </car> <person> <licenseNumber> 02389749372 </licenseNumber> <name>Alexa