(item)
| 123 | |
| 124 | @staticmethod |
| 125 | def _get_valid_attrs(item): |
| 126 | key_attrs = {"class", "style"} |
| 127 | attrs = { |
| 128 | k: v if v != [] else "" for k, v in item.attrs.items() if k in key_attrs |
| 129 | } |
| 130 | |
| 131 | for attr in key_attrs: |
| 132 | if attr not in attrs: |
| 133 | attrs[attr] = "" |
| 134 | return attrs |
| 135 | |
| 136 | @staticmethod |
| 137 | def _child_has_text(child, text, url, text_fuzz_ratio): |