I want to remove this sentence when I try to get some information. '(adsbygoogle = window.adsbygoogle || []).push({})'
So, I tried to this code using the re module, but I can't help it.
keywords = '(adsbygoogle = window.adsbygoogle || []).push({}) <div class=" pirce.pdf0.92MB carzip.tistory.com remain)'
cleantext = re.sub('\(', '<', keywords)
cleantext = re.sub('\)', '>', cleantext)
cleantext = re.sub('<ads*[^)]+>', '', cleantext)
cleantext = re.sub('<','(',cleantext)
cleantext = re.sub('>', ')', cleantext)
print(cleantext)
--> result : None
I want 'remain' remain after print(cleantext) but I got the result None. I think re module + grammar run maximum size. how to handle this problem?
thanks first.
I want the words "remain" to remain after print(cleantext)