Created
December 1, 2020 19:28
-
-
Save ahmedshahriar/7febc6cd760693b4d0d7e52e77f25342 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
A simple regex approach to find specific portion (in this case post id) from a http link | |
''' | |
import re | |
link = "https://www.facebook.com/marketplace/item/391273608941747/?ref=search&referral_code=undefined" | |
print(re.findall("marketplace/item/(\S*)/", str(link))[0]) | |
# output | |
# 391273608941747 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment