Returns: bool: Whether the user has a scratch membership badge on their profile (located next to the follow button)
(self)
| 716 | return commons.webscrape_count(text, "Favorites (", ")") |
| 717 | |
| 718 | def has_badge(self) -> bool: |
| 719 | """ |
| 720 | Returns: |
| 721 | bool: Whether the user has a scratch membership badge on their profile (located next to the follow button) |
| 722 | """ |
| 723 | with requests.no_error_handling(): |
| 724 | resp = requests.get(self.url) |
| 725 | soup = BeautifulSoup(resp.text, "html.parser") |
| 726 | head = soup.find("div", {"class": "box-head"}) |
| 727 | if not head: |
| 728 | return False |
| 729 | for child in head.children: |
| 730 | if child.name == "img": |
| 731 | if "membership-badge.svg" in child["src"]: |
| 732 | return True |
| 733 | return False |
| 734 | |
| 735 | def toggle_commenting(self): |
| 736 | """ |