I got the following code, that should be used in another function, so I want to pass it using a variable
soup.find("div", {"class" : "article-entry text"}).text.replace('\n', "")
Using
textFormat = "soup.find("div", {"class" : "article-entry text"}).text.replace('\n', "")"
doesn't work obviously. Do I have to escape characters? How?
What would be the best way to execute the content of textFormat. Like so?
text = exec(textFormat)
Thanks!