I'm studying scraping in Python. I wanted to get the value for each page, but I got the value that the class name etc. does not cover. So, this time, I would like to carry out "a strategy of plundering only the part that is a regular expression by combining all the arrays for each page for the time being".
I want only this ** Japan **
list = ['Hide', 'Hide', 'Hide', 'Hide', 'Hide', 'Japan', 'Hide']
list_join = (''.join(list))
print(list_join)
#Hide Hidden Hidden Hidden Hidden Japan Hidden
list_join = (''.join(list))
compile = re.compile('[a-zA-Z]+')
print(''.join(compile.findall(list_join)))
# Japan
reference https://murashun.jp/blog/20200113-20.html https://note.nkmk.me/python-re-regex-character-type/
Recommended Posts