Wednesday 28 September 2016

Scraping Yelp Business Data With Python Scraping Script

Scraping Yelp Business Data With Python Scraping Script

Yelp is a great source of business contact information with details like address, postal code, contact information; website addresses etc. that other site like Google Maps just does not. Yelp also provides reviews about the particular business. The yelp business database can be useful for telemarketing, email marketing and lead generation.

Are you looking for yelp business details database? Are you looking for scraping data from yelp website/business directory? Are you looking for yelp screen scraping software? Are you looking for scraping the business contact information from the online Yelp? Then you are at the right place.

Here I am going to discuss how to scrape yelp data for lead generation and email marketing. I have made a simple and straight forward yelp data scraping script in python that can scrape data from yelp website. You can use this yelp scraper script absolutely free.

I have used urllib, BeautifulSoup packages. Urllib package to make http request and parsed the HTML using BeautifulSoup, used Threads to make the scraping faster.
Yelp Scraping Python Script

import urllib
from bs4 import BeautifulSoup
import re
from threading import Thread

#List of yelp urls to scrape
url=['http://www.yelp.com/biz/liman-fisch-restaurant-hamburg','http://www.yelp.com/biz/casa-franco-caramba-hamburg','http://www.yelp.com/biz/o-ren-ishii-hamburg','http://www.yelp.com/biz/gastwerk-hotel-hamburg-hamburg-2','http://www.yelp.com/biz/superbude-hamburg-2','http://www.yelp.com/biz/hotel-hafen-hamburg-hamburg','http://www.yelp.com/biz/hamburg-marriott-hotel-hamburg','http://www.yelp.com/biz/yoho-hamburg']

i=0
#function that will do actual scraping job
def scrape(ur):

          html = urllib.urlopen(ur).read()
          soup = BeautifulSoup(html)

      title = soup.find('h1',itemprop="name")
          saddress = soup.find('span',itemprop="streetAddress")
          postalcode = soup.find('span',itemprop="postalCode")
          print title.text
          print saddress.text
          print postalcode.text
          print "-------------------"

threadlist = []

#making threads
while i<len(url):
          t = Thread(target=scrape,args=(url[i],))
          t.start()
          threadlist.append(t)
          i=i+1

for b in threadlist:
          b.join()

Recently I had worked for one German company and did yelp scraping project for them and delivered data as per their requirement. If you looking for scraping data from business directories like yelp then send me your requirement and I will get back to you with sample.

Source: http://webdata-scraping.com/scraping-yelp-business-data-python-scraping-script/

Thursday 15 September 2016

Web Scraping – A trending technique in data science!!!

Web Scraping – A trending technique in data science!!!

Web scraping as a market segment is trending to be an emerging technique in data science to become an integral part of many businesses – sometimes whole companies are formed based on web scraping. Web scraping and extraction of relevant data gives businesses an insight into market trends, competition, potential customers, business performance etc.  Now question is that “what is actually web scraping and where is it used???” Let us explore web scraping, web data extraction, web mining/data mining or screen scraping in details.

What is Web Scraping?

Web Data Scraping is a great technique of extracting unstructured data from the websites and transforming that data into structured data that can be stored and analyzed in a database. Web Scraping is also known as web data extraction, web data scraping, web harvesting or screen scraping.

What you can see on the web that can be extracted. Extracting targeted information from websites assists you to take effective decisions in your business.

Web scraping is a form of data mining. The overall goal of the web scraping process is to extract information from a websites and transform it into an understandable structure like spreadsheets, database or csv. Data like item pricing, stock pricing, different reports, market pricing, product details, business leads can be gathered via web scraping efforts.

There are countless uses and potential scenarios, either business oriented or non-profit. Public institutions, companies and organizations, entrepreneurs, professionals etc. generate an enormous amount of information/data every day.

Uses of Web Scraping:

The following are some of the uses of web scraping:

  •     Collect data from real estate listing
  •     Collecting retailer sites data on daily basis
  •     Extracting offers and discounts from a website.
  •     Scraping job posting.
  •     Price monitoring with competitors.
  •     Gathering leads from online business directories – directory scraping
  •     Keywords research
  •     Gathering targeted emails for email marketing – email scraping
  •     And many more.

There are various techniques used for data gathering as listed below:

  •     Human copy-and-paste – takes lot of time to finish when data is huge
  •     Programming the Custom Web Scraper as per the needs.
  •     Using Web Scraping Softwares available in market.

Are you in search of web data scraping expert or specialist. Then you are at right place. We are the team of web scraping experts who could easily extract data from website and further structure the unstructured useful data to uncover patterns, and help businesses for decision making that helps in increasing sales, cover a wide customer base and ultimately it leads to business towards growth and success.

We have got expertise in all the web scraping techniques, scraping data from ajax enabled complex websites, bypassing CAPTCHAs, forming anonymous http request etc in providing web scraping services.

Source: http://webdata-scraping.com/web-scraping-trending-technique-in-data-science/

Tuesday 6 September 2016

Benefits of Ruby over Python & R for Web Scraping

Benefits of Ruby over Python & R for Web Scraping

In this data driven world, you need to be constantly vigilant, as information and key data for an organization keeps changing all the while. If you get the right data at the right time in an efficient manner, you can stay ahead of competition. Hence, web scraping is an essential way of getting the right data. This data is crucial for many organizations, and scraping technique will help them keep an eye on the data and get the information that will benefit them further.

Web scraping involves both crawling the web for data and extracting the data from the page. There are several languages which programmers prefer for web scraping, the top ones are Ruby, Python & R. Each language has its own pros and cons over the other, but if you want the best results and a smooth flow, Ruby is what you should be looking for.

Ruby is very good at production deployments and using Ruby, Redis & Chef have proven to be a great combination. String manipulation in Ruby is very easy because it is based on Perl syntax. Also, Ruby is great for analyzing web pages using  one of the very powerful gems called Nokogiri. Nokogiri is much easier to use as compared to other packages and libraries used by R and Python respectively. Nokogiri can deal with broken HTML / HTML fragments easily. Ruby also has many extensions, such as Sanitize and Loofah, that can help clean up broken HTML.

Python programmers widely use a library called Beautiful Soup for pulling data out of HTML & XML files. It works with your favorite parser to provide idiomatic ways of navigating, searching, and modifying the parse tree. It commonly saves programmers hours or days of work. R programmers have a new package called rvest that makes it easy to scrape data from html web pages, by libraries like beautiful soup. It is designed to work with magrittr so that you can express complex operations as elegant pipelines composed of simple, easily understood pieces.

To help you understand it more effectively, below is a comprehensive infographic for the same.

Ruby is far ahead of Python & R for cloud development and deployments.  The Ruby Bundler system is just great for managing and deploying packages from Github. Using Chef, you can start up and tear down nodes on EC2, at will, and monitor for failures,  scale up or down, reset your IP addresses, etc. Ruby also has great testing frameworks like Fakeweb and Capybara, making it almost trivial to build a great suite of unit tests and to include advanced features, like crawling  and scraping using webkit / selenium. 

The only disadvantage to Ruby is lack of machine learning and NLP toolkits, making it much harder to emulate the capacity of a tool like Pattern.  It can still be done, however, since most of the heavy lifting can be done asynchronously using Unix tools like liblinear or vowpal wabbit.

Conclusion

Each language has its plus point and you can pick the one which you are most comfortable with. But if you are looking for smooth web scraping experience, then Ruby is the best option. That has been our choice too for years at PromptCloud for the best web scraping results. If you have any further questions about this, then feel free to get in touch with us.

Source: https://www.promptcloud.com/blog/benefits-of-ruby-for-web-scraping