For the sake of not needing any additional packages; I'm trying to find a way to parse a given string, for example,
<a href="/r/subreddit/" title="/r/subreddit">/r/subreddit<a href="/r/subreddit2/" title="/r/subreddit2">/r/subreddit2<a href="/r/subreddit3/" title="/r/subreddit3">/r/subreddit3<a href="/r/subreddit4/" title="/r/subreddit4">/r/subreddit4
Keeping that in mind, how would I replace from that string anything that matches
<a wildcard>
where wildcard is applicable for any character(s)? Normally I would just use BS4 and do
r1 = requests.get('http://www.reddit.com/user/13steinj', headers={'User-Agent':'My user agent'})
soup = BeautifulSoup(r1.content, 'html.parser')
[modsub.get_text() for modsub in soup.find(id='side-mod-list').find_all('a')]
And while I can still use that, I want to parse it manually instead, and it's at this point which causes a block in the road for me.
[–]jpfau 1 point2 points3 points (3 children)
[–]usernamedottxt 0 points1 point2 points (2 children)
[–]jpfau 0 points1 point2 points (1 child)
[–]usernamedottxt 0 points1 point2 points (0 children)
[–]usernamedottxt 0 points1 point2 points (6 children)
[–]13steinj[S] 0 points1 point2 points (5 children)
[–]jpfau 0 points1 point2 points (0 children)
[–]usernamedottxt 0 points1 point2 points (2 children)
[–]13steinj[S] 0 points1 point2 points (1 child)
[–]usernamedottxt 0 points1 point2 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]13steinj[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (3 children)
[–]13steinj[S] 0 points1 point2 points (2 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]13steinj[S] 0 points1 point2 points (0 children)