openzim / python-scraperlib

Collection of Python code to re-use across Python-based scrapers
GNU General Public License v3.0
18 stars 16 forks source link

Fix zim url rewritting on node without expected attribute #32

Closed satyamtg closed 4 years ago

satyamtg commented 4 years ago

This prevents KeyError while rewriting links if the HTML tag doesn't contain the attribute holding the link. For example, tags without href are still valid.

Also adds object element link rewriting if data attribute contains a link.

codecov[bot] commented 4 years ago

Codecov Report

Merging #32 into master will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master       #32   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          752       754    +2     
=========================================
+ Hits           752       754    +2     
Impacted Files Coverage Δ
src/zimscraperlib/zim/rewriting.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update efa423a...fe5fa75. Read the comment docs.