ใช้ Python regex ดึง URL จาก HTML link
ตัวอย่าง
import re
s = '''https://www.santa.com'''
match = re.search(r'href=[\'"]?([^\'" >]+)', s)
if match:
print(match.group(0))
ผลลัพธ์
href="https://www.santa.com"
ใช้ Python regex ดึง URL จาก HTML link
import re
s = '''https://www.santa.com'''
match = re.search(r'href=[\'"]?([^\'" >]+)', s)
if match:
print(match.group(0))
href="https://www.santa.com"