Answer the question
In order to leave comments, you need to log in
Selenium+Xpath. How to get a chain of categories?
Good day.
By this link
I want to get a list of categories (breadcrumbs) "Main Catalog Car tools BMW tools"
separated by commas or spaces.
I'm trying with a simple script:
[Reflection.Assembly]::LoadFrom("C:\selenium\net40\WebDriver.dll")
$ie = New-Object OpenQA.Selenium.Firefox.FirefoxDriver
$ie.Navigate().GoToUrl("http://car-tool.ru/catalog/bmw-tools/fiksator_kolenvala_bmw_b38/")
Start-Sleep 5
$ie.FindElementByXPath("//ul[@class='breadcrumb-navigation']/li/a")
$ie.Quit()
Answer the question
In order to leave comments, you need to log in
In js, write a function that, depending on the number of incoming files, builds the desired grid (with the required number of elements), and then everything is formatted through CSS and that's it. Or a similar option - js looks at the number of objects and adds a modifier class to the parent container.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question