Answer the question
In order to leave comments, you need to log in
How to parse words from a website in Python?
Hello. I have never parsed information from sites until now. There was a need to parse words from the site into an array (or into a file)
From here you need to parse -
study-english.info/vocabulary-american-slang.php
What should the Python code look like? (Preferably use XPath from lxml)
Answer the question
In order to leave comments, you need to log in
result = {}
for item in html.xpath('.//td/b/../following-sibling::td'):
result[item.xpath('preceding-sibling::td')[0].text_content().strip()] = item.text_content().strip()
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question