N
N
nik2102019-05-04 18:06:22
Python
nik210, 2019-05-04 18:06:22

Is there a chrome extension that makes PyQuery parsing easier?

I am mastering such a thing in python as PyQuery for parsing sites, python is more or less familiar to me, but I am weak in web programming, I don’t know how to extract information from some sites when parsing.
Here, for example, parse news from Yandex:

from pyquery import PyQuery 
import os 
pc = PyQuery(url="https://yandex.ru/") 
for i in pc.items('.home-link.list__item-content'): 
    print (i.attr('aria-label')) 
os.system("pause")

For me, the most difficult thing was to find (.home-link.list__item-content) and ('aria-label'), although I use the developer console (F12)
Question: is there such an extension in the google chrome browser that will show the page structure, for convenience of parsing?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2019-05-04
@nik210

In the browser devtools, select the desired element and copy its selector through the right click.

I
Ivan Shumov, 2019-05-04
@inoise

What you need is the developer console. You just don't know how to use it

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question