Skip to content

Added parser function and replaced rsplit with url_parser#62

Open
tiyingxu wants to merge 1 commit intomasterfrom
fix/url_parser
Open

Added parser function and replaced rsplit with url_parser#62
tiyingxu wants to merge 1 commit intomasterfrom
fix/url_parser

Conversation

@tiyingxu
Copy link
Copy Markdown
Contributor

I created a url splitting function in utils.py and replaced all instances of rsplit in models.py with the new function url_parser().

@tiyingxu tiyingxu self-assigned this Nov 21, 2018
@tiyingxu tiyingxu requested a review from hongee November 21, 2018 03:34
Copy link
Copy Markdown
Contributor

@hongee hongee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

made a few comments!


def url_parser(url_string):
domain = url_string.split("?")
separate = domain[0].split('/')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a couple of potential issues with this approach - the "/" can show up in multiple places, and I can't recall if urls can only contain one ?. Have you tried looking at https://docs.python.org/3/library/urllib.parse.html?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants