xpath

Building Chrome extension using xpath and Cross-Origin XMLHttpRequest

会有一股神秘感。 提交于 2020-01-30 10:58:08
问题 I'm currently trying to build my first Chrome extension but I'm having a slight issue with my code. I want to use XMLHTTPRequest and xpath to display a specific number from an external website as a badge on my icon. The code I'm using in my background.js file is as follows: var xhr = new XMLHttpRequest(); xhr.open("GET", "http://www.example.com", true); xhr.onreadystatechange = function() { if (xhr.readyState == 4) { // innerText does not let the attacker inject HTML elements. document

Please Assist with XPath Problem for Google Sheets ImportXML Function

China☆狼群 提交于 2020-01-30 09:21:09
问题 I can't figure out the correct XPath to use in Google Sheets for extracting the 3 (three) "Yield on Cost" values at the top of this page: https://seekingalpha.com/symbol/GE/dividends/yield-on-cost Or the 5 (five) "Growth" values at the top of this page: https://seekingalpha.com/symbol/GE/dividends/dividend-growth I have read many informative webpages on the subject of using both IMPORTXML and IMPORTHTML within Google Sheets, and I have had good success in the past -- but I am coming up empty

How to resolve org.openqa.selenium.ElementNotVisibleException using Selenium with Java in Amazon Sign In

杀马特。学长 韩版系。学妹 提交于 2020-01-30 09:04:34
问题 package newpackage; import java.util.List; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.interactions.Actions; public class OpenAmazon { public static void main(String[] args) { WebDriver driver; System.setProperty("webdriver.chrome.driver", "C:\\Program Files\\chromedriver_win32\\chromedriver.exe"); driver=new

How to edit specific xml using xpath

China☆狼群 提交于 2020-01-30 08:27:05
问题 I have got below xml which is genrated using xslt function json-to-xml(). I need to update this xml as shown in Result xml using given xpaths. I need the solution in java or xslt. Any help would be much appreciated. XML <?xml version="1.0" encoding="UTF-8"?> <map xmlns="http://www.w3.org/2005/xpath-functions"> <map key="Response"> <map key="Headers"> <string key="server">Lisa</string> <string key="Status-Code">200</string> <string key="Content-Type">applicaton/json</string> </map> <map key=

How to get text of an element on the basis of other element's text value on the same row in the table?

纵饮孤独 提交于 2020-01-30 08:12:28
问题 I need to find the text of an element "score" on the basis of other element "SF Lead ID" on the same row. "SF Lead ID" can be dynamic. for example am using hard coded value here. String sf_id = "00Q1l000003clVhEAI"; //this value is dynamic String text= dvr.findElement(By.xpath("//*/tr/[contains(text(),'" + sf_id + "')]//*[@id='lead-score']")).getText(); Please look the html structure on the above image. help me to correct the xpath. Currently its throwing below error - org.openqa.selenium

How to get text of an element on the basis of other element's text value on the same row in the table?

橙三吉。 提交于 2020-01-30 08:12:08
问题 I need to find the text of an element "score" on the basis of other element "SF Lead ID" on the same row. "SF Lead ID" can be dynamic. for example am using hard coded value here. String sf_id = "00Q1l000003clVhEAI"; //this value is dynamic String text= dvr.findElement(By.xpath("//*/tr/[contains(text(),'" + sf_id + "')]//*[@id='lead-score']")).getText(); Please look the html structure on the above image. help me to correct the xpath. Currently its throwing below error - org.openqa.selenium

How to get text of an element on the basis of other element's text value on the same row in the table?

久未见 提交于 2020-01-30 08:12:06
问题 I need to find the text of an element "score" on the basis of other element "SF Lead ID" on the same row. "SF Lead ID" can be dynamic. for example am using hard coded value here. String sf_id = "00Q1l000003clVhEAI"; //this value is dynamic String text= dvr.findElement(By.xpath("//*/tr/[contains(text(),'" + sf_id + "')]//*[@id='lead-score']")).getText(); Please look the html structure on the above image. help me to correct the xpath. Currently its throwing below error - org.openqa.selenium

XPath query into hierarchical data, preserving ancestor–descendant relationship

和自甴很熟 提交于 2020-01-30 07:54:25
问题 How can I express to PostgreSQL that I want values simultaneously from several hierarchical levels in an XPath query ? I have a document (in a PostgreSQL XML value) with a multi-level hierarchy. For this question, an example can be created with: SELECT XMLPARSE(DOCUMENT ' <parrots> <parrot name="Fred"> <descriptor>Beautiful plumage</descriptor> <descriptor>Resting</descriptor> </parrot> <parrot name="Ethel"> <descriptor>Pining for the fjords</descriptor> <descriptor>Stunned</descriptor> <

XPath query into hierarchical data, preserving ancestor–descendant relationship

牧云@^-^@ 提交于 2020-01-30 07:53:06
问题 How can I express to PostgreSQL that I want values simultaneously from several hierarchical levels in an XPath query ? I have a document (in a PostgreSQL XML value) with a multi-level hierarchy. For this question, an example can be created with: SELECT XMLPARSE(DOCUMENT ' <parrots> <parrot name="Fred"> <descriptor>Beautiful plumage</descriptor> <descriptor>Resting</descriptor> </parrot> <parrot name="Ethel"> <descriptor>Pining for the fjords</descriptor> <descriptor>Stunned</descriptor> <

Why doesn't this PHP SimpleXML XPath find the values?

别来无恙 提交于 2020-01-30 06:42:08
问题 I'm expecting an array of Amount , but for some reason it refused to be found. I tried many combinations of setting the name space, but it gives the error SimpleXMLElement::xpath(): Undefined namespace prefix . Code // $xml->registerXPathNamespace("amazon", "http://webservices.amazon.com/AWSECommerceService/2011-08-01"); // $item->registerXPathNamespace("amazon", "http://webservices.amazon.com/AWSECommerceService/2011-08-01"); // $possiblePrices = $item->OfferSummary->xpath('//amazon:Amount')