Skip to content

About

This code will help you make a 'requests headers' to a dictionary in python.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Auto-Headers-Maker

This code will help you make a 'requests headers' to a dictionary in python.

Replace the string = ''' request headers ''' Then run the code.

It will automatically copy the full format for scraping the a website. Like importing beautifulSoup, requests, pandas.

Make the requests headers a json.

Like:-

input: 
string = ''' x: y
cookie: sdfhsd
user-agent : shsdf '''


output:
import pandas as pd
from bs4 import BeautifulSoup as bs
import requests as req

headers = {
'x': 'y',
'cookie':'sdfhsd',
'user-agent':'sdsdf'
}


link = ''   # input the link you want to scrape, here
r = req.get(link,headers = headers)
soup = bs(r.content,'html.parser')
print(soup)

About

This code will help you make a 'requests headers' to a dictionary in python.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages