DOMPath | Chrome DevTools DOMPath implementation dart :floppy_disk
kandi X-RAY | DOMPath Summary
kandi X-RAY | DOMPath Summary
Get selector, JS Path and XPath of a DOM element.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Compare two nodes .
- prefixed class names
- Return a selector string .
DOMPath Key Features
DOMPath Examples and Code Snippets
Community Discussions
Trending Discussions on DOMPath
QUESTION
I have 2 files : one is MAIN.py
and other is xpath_from_element.js
. I used QWebEngineWidgets
to display the web-page on the app, And linked both .py
and .js
to get TagNames
/XPATH
from the website when one clicks on it. I am currently getting tagNames
of the elements.
What if i have to get tagNames
and classNames
both at once. For example : clicking on a button gives me both tagName
and className
at once. Because currently it's giving me only one. I have tried doing that, but it always gives me error, so i have posted the original fine running code and not my error producing code cause i don't know how to do that and was unable to find any resources to do so.
Here is Main.py :
...ANSWER
Answered 2020-Apr-07 at 15:35The logic is similar to my other answers that I have provided, but you may not understand it because you probably have not analyzed it in detail.
The logic is:
Create a class that inherits from Element and override the script method that implements the logic of the program (in this case load the script xpath_from_element.js, implement the algorithm of obtaining the clicked element, obtain the necessary attributes and send them to a slot) .
Create a signal with the necessary number of arguments (in this case the xpath and tagName)
Create a slot where the information is received and emit the signal.
With the above I hope you understand the simple logic of my implementation.
QUESTION
I am working with pyqt5. I want user to click the browser embeded on my pyqt5 application to get the XPATH of the element which he/she is clicking on it.
I got the solution how to implement the above idea by someone but the page on the browser gets redirected to another page of the website.
What if I want the user to click the element, but not allowing him to go further by clicking on the buttons and getting away from the original page. In short, I just want to stick on that same page without redirecting to the another one so as to get the XPATH's of the same page only.
Here's the working code as follows suggested by @eyllanesc :
My file
...ANSWER
Answered 2020-Mar-04 at 02:01One possible solution is that the event is not transmitted to the element that is clicked using the preventDefault()
method:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install DOMPath
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page