S
S
Satangelus2018-06-09 10:34:56
C++ / C#
Satangelus, 2018-06-09 10:34:56

Can't see page element id? I can not determine the id of the Ali-Express form field (selenium)?

I set out to write a spider to track the prices of goods on ali-express.
The problem is that a very big newbie in this area. I started from the very initial task, from the login ( https://login.aliexpress.com ). And I ran into an incomprehensible organization of the html-page. I found a div that contains the login form xpath = //*[@id='expressbuyerlogin']
And then complete misunderstandings. Using the selenium ide add-on, I determined the id of the form fields (fm-login-id, fm-login-password, fm-login-submit) by opening the page sources and I see that there are no tags with such id nicknames in the text of the page itself. At the same time, if you look at the source code of the frame using the developer's tools, then they are there.
Next I write the code:

//  залогинимся на сайт 
                driver.Navigate().GoToUrl("https://login.aliexpress.com");
                var Фрейм = driver.FindElement(By.XPath("//*[@id='expressbuyerlogin']"));
                var ЛогинПанель = Фрейм.FindElement(By.Id("alibaba-login-box"));
                var ЛогинЭлемент = ЛогинПанель.FindElement(By.XPath("//*[@id='fm - login - id']"));

On the last line it gives gpf.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Eremin, 2018-06-09
@Satangelus

1. extra spaces

LoginPanel.FindElement(By.XPath("//*[@id='fm - login - id']"))

2. What is the problem? the paragram fails because there are no id's?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question