xpath

Scrapy: extract JSON from within HTML script

て烟熏妆下的殇ゞ 提交于 2020-12-29 08:19:49
问题 I'm trying to extract (what appears to be) JSON data from within an HTML script. The HTML script looks like this on the site: <script> $(document).ready(function(){ var terms = new Verba.Compare.Collections.Terms([{"id":"6436","name":"SUMMER 16","inquiry":true,"ordering":true},{"id":"6517","name":"FALL 16","inquiry":true,"ordering":true}]); var view = new Verba.Compare.Views.CourseSelector({el: "body", terms: terms}); }); </script> I'd like to pull out the following: [{"id":"6436","name":

Selenium - Finding element based on ember

99封情书 提交于 2020-12-27 07:15:26
问题 I am working with selenium in python 3.6 on the chrome browser. I have programmed it to the point where I can access the website I want but I am struggling to find the text box element I am searching for. When I inspect the element it has this code. <input placeholder="" id="ember32" class="ssRegistrationField ssEmailTextboxField ember-text-field ember-view" type="email"> But when I try and use the given ID, it does not work and says that it cannot be found. Here is my code (Without the text

How to select a country from https://www.aliexpress.com/ ship to drowdown menu using Selenium and Python

倖福魔咒の 提交于 2020-12-21 03:55:51
问题 On the website https://www.aliexpress.com, I need to change the country from the dropdown menu using selenium <span class="ship-to"> I can't find how I click on the country value using selenium 回答1: From the Ship to drop-down-menu to select the country as Afghanistan you have to induce WebDriverWait for the element_to_be_clickable() and you can use the following xpath based Locator Strategies: Code Block: driver.get("https://www.aliexpress.com/") WebDriverWait(driver, 20).until(EC.element_to

How to select a country from https://www.aliexpress.com/ ship to drowdown menu using Selenium and Python

蹲街弑〆低调 提交于 2020-12-21 03:55:51
问题 On the website https://www.aliexpress.com, I need to change the country from the dropdown menu using selenium <span class="ship-to"> I can't find how I click on the country value using selenium 回答1: From the Ship to drop-down-menu to select the country as Afghanistan you have to induce WebDriverWait for the element_to_be_clickable() and you can use the following xpath based Locator Strategies: Code Block: driver.get("https://www.aliexpress.com/") WebDriverWait(driver, 20).until(EC.element_to

Message “org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the XPath expression” using sendKeys

假装没事ソ 提交于 2020-12-21 02:15:51
问题 I am having trouble trying to upload a file using Selenium. I am not able to use the sendKeys() function to pass the path due to the browse button not having an input tag. It's written in Angular. Here's the browse button element: <a id="attachmentUpload-browse0" name="attachmentUpload-browse0" ng-click="clickBrowse($index)" class="btn-pri" xpath="1"></a> I did find an input tag right below the code above in the source, but I am getting errors when trying to use .sendKeys() . <input type=

Message “org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the XPath expression” using sendKeys

我们两清 提交于 2020-12-21 02:13:31
问题 I am having trouble trying to upload a file using Selenium. I am not able to use the sendKeys() function to pass the path due to the browse button not having an input tag. It's written in Angular. Here's the browse button element: <a id="attachmentUpload-browse0" name="attachmentUpload-browse0" ng-click="clickBrowse($index)" class="btn-pri" xpath="1"></a> I did find an input tag right below the code above in the source, but I am getting errors when trying to use .sendKeys() . <input type=

Message “org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the XPath expression” using sendKeys

时光毁灭记忆、已成空白 提交于 2020-12-21 02:13:02
问题 I am having trouble trying to upload a file using Selenium. I am not able to use the sendKeys() function to pass the path due to the browse button not having an input tag. It's written in Angular. Here's the browse button element: <a id="attachmentUpload-browse0" name="attachmentUpload-browse0" ng-click="clickBrowse($index)" class="btn-pri" xpath="1"></a> I did find an input tag right below the code above in the source, but I am getting errors when trying to use .sendKeys() . <input type=

Remove external tag with xpath wso2

不打扰是莪最后的温柔 提交于 2020-12-15 05:28:40
问题 how can I achieve this with xpath in wso2? Example: <TEMP> <NAME>GEORGE</NAME> <COGNOME>MENDEZ</COGNOME> <BUSINESSNAME/> <CHANNEL>X091</CHANNEL> </TEMP> Result: <NAME>GEORGE</NAME> <COGNOME>MENDEZ</COGNOME> <BUSINESSNAME/> <CHANNEL>X091</CHANNEL> Thanks 回答1: The XML generated needs to have a root element. Therefore you will not be able to create the following payload, which does not have a root element. <NAME>GEORGE</NAME> <COGNOME>MENDEZ</COGNOME> <BUSINESSNAME/> <CHANNEL>X091</CHANNEL>

Python3 Scraping all informations of one page

﹥>﹥吖頭↗ 提交于 2020-12-15 05:24:26
问题 My Spider: import scrapy class LinkSpider(scrapy.Spider): name = "page" start_urls = [ 'https://www.topart-online.com/de/Blattzweige-Blatt-und-Bluetenzweige/l-KAT282?seg=1' ] def parse(self, response): yield{ 'ItemSKU': response.xpath('//span[@class="sn_p01_pno"]/text()').getall(), 'title': response.xpath('//div[@class="sn_p01_desc h4 col-12 pl-0 pl-sm-3 pull-left"]/text()').getall(), 'ItemEAN': response.xpath('//div[@class="productean"]/text()').getall(), 'Delivery_Status': response.xpath('/

How to show information about the selected Engineering Tools using xPath in PHP

不羁的心 提交于 2020-12-14 23:51:17
问题 Good day everyone. I'm working on a very simple application and I want to implement something that will allow the user to choose a tool from a drop down menu, and after clicking the submit button it will show the information of the chosen tool by extracting the information from the XML File. I created the dropdown menu by extracting the tool names from the XML file: <form method="POST" action="showspecifictool.php"> <select id="choose" name="choose"> <?php $tools = simplexml_load_file('tools