Beautifulsoup: Scraping Google with Python for Searching Job

 Beautifulsoup: Scraping Google with Python for Searching Job !


Learning to use Beautifulsoup for Web Scraping !


So adding some useful Python Beautifulsoup python scripts that I was able to change and use and that works on Python 3.6.4 ....

In this post we are going to look at scraping Google on Job results keywords searching using Python.


The below Python Beautifulsoup web scraping script will able to search Job's or any content you want to search in variable text .


#################################################################################


import urllib

from bs4 import BeautifulSoup

import requests

import webbrowser


text = 'Job 5+ Years Experience, Deployment, WebSphere, Oracle, Weblogic Administrator, Intellect, Configuration Manager, Chennai'


text = urllib.parse.quote_plus(text)

url = 'https://google.com/search?q=' + text

response = requests.get(url)


#with open('output.html', 'wb') as f:

# f.write(response.content)

#webbrowser.open('output.html')


soup = BeautifulSoup(response.text, 'lxml')

for g in soup.find_all(class_='g'):

    print(g.text)

    print('-----')


#################################################################################


import urllib

from bs4 import BeautifulSoup

import requests

import webbrowser

text = 'Job, Deployment, WebSphere, Oracle, Weblogic Administrator, Intellect, Configuration Manager, Chennai'

text = urllib.parse.quote_plus(text)

url = 'https://google.com/search?q=' + text

response = requests.get(url)


with open('output.html', 'wb') as f:

    f.write(response.content)

webbrowser.open('output.html')


soup = BeautifulSoup(response.text, 'lxml')

for g in soup.find_all(class_='g'):

    print(g.text)

    print('-----')


#################################################################################

No comments:

Post a Comment