Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asynchronous retrieval of source code and dependencies #21

Open
rilma opened this issue Jan 20, 2022 · 0 comments
Open

Asynchronous retrieval of source code and dependencies #21

rilma opened this issue Jan 20, 2022 · 0 comments

Comments

@rilma
Copy link
Owner

rilma commented Jan 20, 2022

import re
from typing import List
from bs4 import BeautifulSoup
from urllib.request import Request, urlopen

def _get_links(url: str, pattern: str=r'.') -> List[str]:
    html_page = urlopen(Request(url))
    soup = BeautifulSoup(html_page, "html.parser")
    links = [link.get('href') for link in soup.findAll('a') if re.match(pattern, link.get('href'), re.DOTALL)]
    return links
FILENAME_REGEX_PATTERN = r'[a-z0-9_]+.[a-z]+'
import os; os.system(f'ls -lah {self.temporary_directory.name}')
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

No branches or pull requests

1 participant