I have some tags as below, they used non standard tag with style "display: none". these can't be parsed so that I want to replace style="display: none;"
to empty string or to style="display: inline;"
.
...
<section id="box3" class="nodisp_zero" style="display: none;">
<h1 id="box_ttl3" style="display: none;"></h1>
<img style="width: 100%; display: none;" id="box_img3" alt="box3" src="https://smtgvs.weathernews.jp/s/topics/img/dummy.png" class="lazy" data-original="https://smtgvs.weathernews.jp/s/topics/img/201808/201808220015_box_img3_A.jpg?1533975785">
<figcaption id="box_caption3" style="display: none;"></figcaption>
<div class="textarea clearfix">
<h2 id="box_subttl3" style="display: none;"></h2>
<div class="fontL" id="box_com3" style="display: none;"></div>
</div>
</section>
...
I tried to use this code, but I got error TypeError: 'NoneType' object is not callable
, what can I do?
driver.get(href)
soup_level2 = BeautifulSoup(driver.page_source, 'lxml')
soup_level2 = soup_level2.replace(r'display:\s*none', "")
images = soup_level2.find_all('img')