+ 2
Use variable with regular expression in python.
How do i use a variable inside the regular expression given below. v = re.findall(r'/VARIABLE/(\d\d\d)">', html)
3 ответов
+ 7
The simplest would be to build the regex pattern by concatenating what is before the string variable, the variable itself and what is after it.
v = re.findall(VARIABLE+r'(\d\d\d)">', html)
+ 3
concatenation!! haha. the answer was so simple yet it had worried.
+ 3
Sure :)
Anyway, there are lots of good libraries for HTML parsing, you could try 'beautifulsoup' for example.
It makes the whole data scraping a loooot easier :)