I am using beautifulSoup to extract data from website. Text from that website changes everytime you reload your page so basically I wish to be able to set a focus on the cla
You can use text or string attribute of the element.
elems = soup.find_all(True, class_='template_title')
print([elem.string for elem in elems])
# prints `['4']` for the given html snippet
Specify more attributes as you want:
elems = soup.find_all(True, class_='template_title',
height='50', valign='bottom', width='535')
i usually use .get_text()
yes,you can
there is a method : .find_all(name, attrs, recursive, string, limit, **kwargs)
**kwargs :recive anything like height ,valign ,width
or
attrs = {'height':'50','valign':'bottom'}