Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # import Regex
- import re
- # open the file and read
- f = open("recaptcha__fr.js", "r")
- content = f.read()
- # Start Conversion : special character to letter
- c1 = re.sub("\\\\u00e9", "é", content)
- c2 = re.sub("\\\\u00ea", "ê", c1)
- c3 = re.sub("\\\\u00ee", "î", c2)
- c4 = re.sub("\\\\u00e8", "è", c3)
- c5 = re.sub("\\\\u00f4", "ô", c4)
- c6 = re.sub("\\\\u00e0", "à", c5)
- # End Conversion
- # get specific text in <strong> ... </strong>
- getStrong = re.findall(r'(?<=<strong>)[\w\s\\\'""\(\)+\.]+(?=</strong>)', c6)
- print(getStrong)
- # convert list to string with newline
- text = '\n'.join(getStrong)
- # create a text file and append data
- creat = open("creat.txt", "w+")
- #-------
- creat.write(text)
- #-------
Add Comment
Please, Sign In to add comment