Python Equivalent to Javascript querySelector
16:44 24 Dec 2019

In the Google Chrome's Inspect element tool you can: right-click on an element > copy > copy js path and you get a nice snippet of code like the following: document.querySelector("#left-container > div.left-content > div > div > ul") that easily gives you the "path" to a selected element in Javascript.

My question is if there is an easy way to turn this javascript snippet into Python possibly using BeautifulSoup that can give me the elements I want from a webpage.

python html beautifulsoup