Below are some tags that use non-standard attributes with the style "display: none". Since these cannot be parsed, I need to either remove style="display: none;"
completely or change it 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 attempted to utilize this code, but encountered an error stating
TypeError: 'NoneType' object is not callable
. What steps can I take to resolve this issue?
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')