Find all list (li) elements in a special position of a web site

So, my idea was to obtain all the elements, tagged with “li” from here – vitoshacademy.com/all, using BeautifulSoup4 and Python.

Initially, I thought about running a simple soup.findAll("li") , but it also added the text from the menus, which were considered also listed items. Thus, there should have been a way to filter out the not needed items. After checking the printed tags, I have noticed, that these are rather descriptive. E.g., with the “Inspect Element” in chrome, one could not see immediately the class, but the “soup” has printed it nicely:

Thus, after some research, the way to print the list items of a given class was considered to be the following:


And in my case, the whole code running looks like this:

Producing the following “report”:

Tagged with: , , , ,