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

Image Scrapper from a website #3244

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#### Name: [Ayushman Pal](https://github.com/WannaCry016)

- Place: Chennai, India
- Bio: Fullstack Developer | Mobile Game Developer | ML/AI Enthusiast
- GitHub: [WannaCry016](https://github.com/WannaCry016)

#### Name: [3mYouOL](https://github.com/3mYouOL)

- Place: Iloilo, Philippines
Expand Down
6 changes: 6 additions & 0 deletions PROJECTS/Download_images_from_websites.py/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Scrap images from URL

1. Dowmload Chrome Drive From Chrome.
2. Run scrap-img.py file `py scrap-img.py`
3. `Enter Path : E:\webscraping\chromedriver_win32\chromedriver.exe` <br/>
`Enter URL : https://dribbble.com/`
1 change: 1 addition & 0 deletions PROJECTS/Download_images_from_websites.py/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
selenium==3.141.0
59 changes: 59 additions & 0 deletions PROJECTS/Download_images_from_websites.py/scrap_img.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from selenium import webdriver
import requests as rq
import os
from bs4 import BeautifulSoup
import time

# path= E:\web scraping\chromedriver_win32\chromedriver.exe
path = input("Enter Path : ")

url = input("Enter URL : ")

output = "output"


def get_url(path, url):
driver = webdriver.Chrome(executable_path=r"{}".format(path))
driver.get(url)
print("loading.....")
res = driver.execute_script("return document.documentElement.outerHTML")

return res


def get_img_links(res):
soup = BeautifulSoup(res, "lxml")
imglinks = soup.find_all("img", src=True)
return imglinks


def download_img(img_link, index):
try:
extensions = [".jpeg", ".jpg", ".png", ".gif"]
extension = ".jpg"
for exe in extensions:
if img_link.find(exe) > 0:
extension = exe
break

img_data = rq.get(img_link).content
with open(output + "\\" + str(index + 1) + extension, "wb+") as f:
f.write(img_data)

f.close()
except Exception:
pass


result = get_url(path, url)
time.sleep(60)
img_links = get_img_links(result)
if not os.path.isdir(output):
os.mkdir(output)

for index, img_link in enumerate(img_links):
img_link = img_link["src"]
print("Downloading...")
if img_link:
download_img(img_link, index)
print("Download Complete!!")
1 change: 1 addition & 0 deletions PROJECTS/Info-Stealers
Submodule Info-Stealers added at 199f7e
16 changes: 16 additions & 0 deletions Python/Nmap_Scanner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import nmap

nm = nmap.PortScanner()

# scan a target host for open ports
nm.scan('localhost', arguments='-p 22,80,443')

# print the state of the ports
for host in nm.all_hosts():
print('Host : %s (%s)' % (host, nm[host].hostname()))
print('State : %s' % nm[host].state())
for proto in nm[host].all_protocols():
print('Protocol : %s' % proto)
ports = nm[host][proto].keys()
for port in ports:
print('port : %s\tstate : %s' % (port, nm[host][proto][port]['state']))
33 changes: 33 additions & 0 deletions profiles/Ayushman Pal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Ayushman Pal

### Location

Chennai, INDIA

### Academics

- Pursuing Btech in Chemical Engineering at Indian Institute of Technology, Madras

### Interests

- Learning Enthusiast
- Music
- Python
- HTML/CSS/JS
- DSA (C++)

### Skills

- DSA
- Typing(with speed more than 140WPM)
- Java
- Git & GitHub
- Python

### Projects

- [Portfolio] https://github.com/WannaCry016

### Profile Link

[Ayushman Pal](https://github.com/WannaCry016)
1 change: 1 addition & 0 deletions scripts/hello_world_WannaCry016.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Hello World")
Loading