Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How can I identify the CSS_Selector, Class, or Element from an object hidden in the HTML?

I’ve been attempting to web scape some detail from the following website, but I’m unable to figure out how to access the class, id, and class type for the following object below.

https://mor.nlm.nih.gov/RxClass/search?query=H%7CATC1-4&searchBy=class&sourceIds=&drugSources=atc1-4%7Catc%2Cepc%7Cfdaspl%2Cmeshpa%7Cmesh%2Cdisease%7Cndfrt%2Cchem%7Cfdaspl%2Cmoa%7Cfdaspl%2Cpe%7Cfdaspl%2Cpk%7Cndfrt%2Cva%7Cndfrt%2Cdispos%7Csnomedct%2Cstruct%7Csnomedct

On the following website with the search condition you’ll see in the center of the screen it

class: SYSTEMIC HORMONAL PREPARATIONS, EXCL. SEX HORMONES AND INSULINS / id: H / class type: ATC1-4 / show context

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I’d like to make the assumption that the above is in bold is a CSS_Selector, but I can’t seem to locate it. The table below it is tr.dbsearch.

Any guidance on how to locate the class, element, or css_selector would be much appreciated.

>Solution :

You can use the developer console in Firefox or any Chromium-based browser: open the contextmenu on the element you want and select Inspect. Then the developer console should open. The current element should be focused in the DOM tree. There you should have the option Copy > CSS selector. And you’re done. In your current case the path is something like this:

html body div.container-fluid div.col-sm-9.col-sm-offset-3.col-md-9.col-md-offset-3.main div#tabContent.tab-content div#drugMemberPane.tab-pane.active div#drugMemberPage.table-responsive div.propText strong

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading