A
A
AlexCruel2020-07-26 14:03:17
Python
AlexCruel, 2020-07-26 14:03:17

How to convert from string to .. string??

You need to pass the find_str string to the parser() method . In the parser, I attach a string to item , but it is read as a string, that is, the find () method is not called.

find_str = "find('div', class_='product__price').find('span').get_text(strip=True)"
site.parser('div', 'product', find_str, 'B2')


'price': item.find_str

How to combine or transform so that it turns out like this:

'price': item.find('div', class_='product__price').find('span').get_text(strip=True)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey, 2020-07-26
@AlexCruel

eval()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question