Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6b54005

Browse files
Fixes-issue-avinashkranjan#1549
1 parent 2717a2c commit 6b54005

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

‎Readme.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# LINK SCRAPPER
2+
3+
4+
- It is used to scrape links from any website and display it.
5+
6+
7+
## Setup instructions
8+
9+
Any PC with python 3 installed can run this code.
10+
11+
12+
## Output
13+
image.png
14+
15+
## Author(s)
16+
17+
Tanya Mohanka

‎script.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import requests
2+
from bs4 import BeautifulSoup
3+
4+
def scrape_links(url):
5+
response = requests.get(url)
6+
soup = BeautifulSoup(response.text, 'html.parser')
7+
links = soup.find_all('a')
8+
for link in links:
9+
href = link.get('href')
10+
if href and href.startswith('http'): # Filter out non-HTTP links
11+
print(href)
12+
13+
# Example usage:
14+
url = 'https://www.linkedin.com/feed/' # Replace with the URL of the website you want to scrape
15+
scrape_links(url)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /