Skip to content

Instantly share code, notes, and snippets.

View harshpanchal-hp's full-sized avatar
🤘
Chill'n

Harsh Panchal harshpanchal-hp

🤘
Chill'n
View GitHub Profile
@harshpanchal-hp
harshpanchal-hp / linkxpath.py
Last active November 2, 2021 08:59
Python Beautifulsoup
import lxml.etree
import requests
# target location
url = 'https://raw.githubusercontent.com/DataFinnovation/public-talks/master/pugs-scraping/example2.html'
# get the page
page = requests.get(url)
# parse it
def moist():
N = int(input())
names = [ input() for x in range(N)]
mov = 0
for i in range(1,N):
if names[i-1] > names[i]:
names[i-1], names[i] = names[i], names[i-1]
mov += 1
return mov