I have a webapp that generates random equations and I am trying to automate the process of solving them with Python:
Can you solve the level 1?<br/><h3><div id='calc'>0 * 8</div></h3><br/>
<form action="play.php" method="post">
 <input type="text" name="res" />
 <input type="submit" value="OK">
</form>
</div>
</body>
I wrote a script to get the equation each time it is generated :
number =  re.findall('<div id='calc'> (.*)</div></h3><br/>', content)[0]
but for some reason it keeps throwing errors
    number =  re.findall('<div id='calc'> (.*)</div></h3><br/>', content)[0]
                                      ^
SyntaxError: invalid syntax
Anyone came cross this before ?
 
     
    
'` is another string. `calc` is invalid syntax for the same reason `"hello"what"world"` is invalid syntax. – ForceBru Nov 04 '20 at 18:15