Wednesday, 20 August 2014

Web Scraping data from different sites


I am looking for a few ideas on how can I solve a design problem I'm going to be faced with building a web scraper to scrape multiple sites. Writing the scraper(s) is not the problem, matching the data from different sites (which may have small differences) is.

For the sake of being generic assume that I am scraping something like this from two or more different sites:

    public class Data {
        public int id;
        public String firstname;
        public String surname;
        ....
    }

If i scrape this from two different sites, I will encounter the situation where I could have the following:

Site A: id=100, firstname=William, surname=Doe

Site B: id=1974, firstname=Bill, surname=Doe

Essentially, I would like to consider these two sets of data the same (they are the same person but with their name slightly different on each site). I am looking for possible design solutions that can handle this.

The only idea I've come up with is scraping the data from a third location and using it as a reference list. Then when I scrape site A or B I can, over time, build up a list of failures and store them in a list for each scraper so that it can know (if i find id=100 then i know that the firstname will be William etc). I can't help but feel this is a rubbish idea!

If you need any more info, or if you think my description is a bit naff, let me know!

Thanks,

DMcB


Source: http://stackoverflow.com/questions/23970057/web-scraping-data-from-different-sites

Tuesday, 19 August 2014

Scrape Data Point Using Python


I am looking to scrape a data point using Python off of the url http://www.cavirtex.com/orderbook .

The data point I am looking to scrape is the lowest bid offer, which at the current moment looks like this:

<tr>
 <td><b>Jan. 19, 2014, 2:37 a.m.</b></td>
 <td><b>0.0775/0.1146</b></td>
 <td><b>860.00000</b></td>
 <td><b>66.65 CAD</b></td>
</tr>

The relevant point being the 860.00 . I am looking to build this into a script which can send me an email to alert me of certain price differentials compared to other exchanges.

I'm quite noobie so if in your explanations you could offer your thought process on why you've done certain things it would be very much appreciated.

Thank you in advance!

Edit: This is what I have so far which will return me the name of the title correctly, I'm having trouble grabbing the table data though.

import urllib2, sys
from bs4 import BeautifulSoup

site= "http://cavirtex.com/orderbook"
hdr = {'User-Agent': 'Mozilla/5.0'}
req = urllib2.Request(site,headers=hdr)
page = urllib2.urlopen(req)
soup = BeautifulSoup(page)
print soup.title



Here is the code for scraping the lowest bid from the 'Buying BTC' table:

from selenium import webdriver

fp = webdriver.FirefoxProfile()
browser = webdriver.Firefox(firefox_profile=fp)
browser.get('http://www.cavirtex.com/orderbook')

lowest_bid = float('inf')
elements = browser.find_elements_by_xpath('//div[@id="orderbook_buy"]/table/tbody/tr/td')

for element in elements:
    text = element.get_attribute('innerHTML').strip('<b>|</b>')
    try:
        bid = float(text)
        if lowest_bid > bid:
            lowest_bid = bid
    except:
        pass

browser.quit()
print lowest_bid

In order to install Selenium for Python on your Windows-PC, run from a command line:

pip install selenium (or pip install selenium --upgrade if you already have it).

If you want the 'Selling BTC' table instead, then change "orderbook_buy" to "orderbook_sell".

If you want the 'Last Trades' table instead, then change "orderbook_buy" to "orderbook_trades".

Note:

If you consider performance critical, then you can implement the data-scraping via URL-Connection instead of Selenium, and have your program running much faster. However, your code will probably end up being a lot "messier", due to the tedious XML parsing that you'll be obliged to apply...

Here is the code for sending the previous output in an email from yourself to yourself:

import smtplib,ssl

def SendMail(username,password,contents):
    server = Connect(username)
    try:
        server.login(username,password)
        server.sendmail(username,username,contents)
    except smtplib.SMTPException,error:
        Print(error)
    Disconnect(server)

def Connect(username):
    serverName = username[username.index("@")+1:username.index(".")]
    while True:
        try:
            server = smtplib.SMTP(serverDict[serverName])
        except smtplib.SMTPException,error:
            Print(error)
            continue
        try:
            server.ehlo()
            if server.has_extn("starttls"):
                server.starttls()
                server.ehlo()
        except (smtplib.SMTPException,ssl.SSLError),error:
            Print(error)
            Disconnect(server)
            continue
        break
    return server

def Disconnect(server):
    try:
        server.quit()
    except smtplib.SMTPException,error:
        Print(error)

serverDict = {
    "gmail"  :"smtp.gmail.com",
    "hotmail":"smtp.live.com",
    "yahoo"  :"smtp.mail.yahoo.com"
}

SendMail("your_username@your_provider.com","your_password",str(lowest_bid))

The above code should work if your email provider is either gmail or hotmail or yahoo.

Please note that depending on your firewall configuration, it may ask your permission upon the first time you try it...



Source: http://stackoverflow.com/questions/21217034/scrape-data-point-using-python

Saturday, 16 August 2014

An Easy Way For Data Extraction

There are so many data scraping tools are available in internet. With these tools you can you download large amount of data without any stress. From the past decade, the internet revolution has made the entire world as an information center. You can obtain any type of information from the internet. However, if you want any particular information on one task, you need search more websites. If you are interested in download all the information from the websites, you need to copy the information and pate in your documents. It seems a little bit hectic work for everyone. With these scraping tools, you can save your time, money and it reduces manual work.

The Web data extraction tool will extract the data from the HTML pages of the different websites and compares the data. Every day, there are so many websites are hosting in internet. It is not possible to see all the websites in a single day. With these data mining tool, you are able to view all the web pages in internet. If you are using a wide range of applications, these scraping tools are very much useful to you.

The data extraction software tool is used to compare the structured data in internet. There are so many search engines in internet will help you to find a website on a particular issue. The data in different sites is appears in different styles. This scraping expert will help you to compare the date in different site and structures the data for records.

And the web crawler software tool is used to index the web pages in the internet; it will move the data from internet to your hard disk. With this work, you can browse the internet much faster when connected. And the important use of this tool is if you are trying to download the data from internet in off peak hours. It will take a lot of time to download. However, with this tool you can download any data from internet at fast rate.There is another tool for business person is called email extractor. With this toll, you can easily target the customers email addresses. You can send advertisement for your product to the targeted customers at any time. This the best tool to find the database of the customers.

However, there are some more scraping tolls are available in internet. And also some of esteemed websites are providing the information about these tools. You download these tools by paying a nominal amount.

Source:http://ezinearticles.com/?An-Easy-Way-For-Data-Extraction&id=3517104

Tuesday, 5 August 2014

Offline Data Entry Services - Surely Affordable to Your Business

Retrieving information becomes easier when we are able to find a better means to keep it organized. In the past, records and documents were usually stockpiled in the backyards or anywhere inside the lockers at the library. However, any firm that wants to push itself to global standards doesn't wish to do so anymore. Current business requirements indicate that data in its most raw form doesn't come good to help any cause of a business. So data processing techniques that presents information, as a byproduct is quite necessary for any business to flourish. Though the data monitoring systems and storage devices of the present moment may be easily subjected to the algorithms of data processing software, the case of manual files is something different.

Preparing computer generated files by employing technicians who feed relevant data into the system from hundreds of files stockpiled in the library at office is not widely encouraged by companies. Companies, which run without stoppage, cannot afford doing this since they have got to concentrate on other core activities that impact their business. This is why companies seek professionals in the field who either individually carries out offline data entry services or team up with others of their class and caliber. Not utilizing the critical functionality of Internet or any other online resources to carry out ordinary data entry practices is widely regarded as the offline data entry services. Businesses keep their favored service providers by sending over hundreds of bulk projects that are to be done minding the time and budget constraints.

For this reason, these businesses are able to get assignments from the same clients as and when the latter puts some additional projects in the pipeline. The capability to handle a large quantity of projects based on Card Entry, Excel Data Entry, Indexing Data Entry, Handwritten Data Entry, Deeds Data Entry, Legal Data Entry, Catalog Data Entry has kept them going for ages now. Unsurprisingly, they should be going on at the same rate as the base of the business keeps expanding seeing that more number of proficient exponents are coming in to this business right now. Traditionally, delegates of such service providers wish to have a deep look at the project requirement of any company that approaches it and only when it is able to match the work to be done with the project budget, they agree to proceed further. This doesn't mean that they are stern when it comes to choosing projects and choosy as to selecting business firms.

They wish to get paid for the services they render, which is not, by any chance, higher than you think of shelling out. To add, outsourcing has been a trend of late and people who are new to such businesses wish to ride on the tide and hence they seek to offer a better price within your means. Therefore if your business requirements want you to hire any of the reliable offline service providers make sure you obtain a quote from other companies as well and do compare between every one of the quote you have on hand. Only then you will have it done quite economically.

Source:http://ezinearticles.com/?Offline-Data-Entry-Services---Surely-Affordable-to-Your-Business&id=4680603

Thursday, 31 July 2014

Importance of Data Cleansing Services

In companies, there is huge amount of data that is available and essential in the decision making and strategies.  Unfortunately, the data is sometimes inaccurate or incomplete because of the updates that are available from time to time. With this, companies are looking for ways to eradicate the information that is not needed by the company. Cleansing of data is one of the processes that can eliminate unnecessary data of the companies. Data cleansing identifies the information that is fraudulent or inaccurate and deletes them or replaces them with the accurate information. Unclean facts have no place in companies because they can also cause inefficiencies and inaccuracies in the decisions. After the cleaning of data, there are no inconsistencies and the data sets are already the same with each other.

There are different techniques used in data cleansing data transformation, parsing or detecting the syntax errors, duplicate eradication, and statistical method. These techniques will ensure that the data are clean and good. There are also criteria to tell if the data set is clean. This are the things that companies look for when getting data cleansing services.

Data should be accurate in which density, integrity, and consistency are there. They should also be complete in order to ensure that there are no differences in the data set. The density will show the relationship of the omitted and the total number of values in the data set. You can tell that the data set is good if it has a good density. Data should also be uniform and the irregularities should be eliminated in the set. Consistency should also be present that eliminates the syntactical errors in the set. Cleaning the data should also give the uniqueness of the set in order to tell the number of duplicates that were present before the cleaning. Lastly, the data should have integrity in combining the criteria of soundness and completeness. If the above criteria are met, it is ensured that the data set is in the best state.

Considering in getting a data cleansing service will offer you different available services. Removal of duplicate ideas is one of the most common features of data cleansing. Same records or data sets are tagged and identified and the duplicates are eradicated. Data are also validated and the bogus data are eliminated. The set will also be checked for outdated data because outdated ones are removed by data cleansing. Incomplete figures are also identified so that they will be given attention. If the incomplete data are identified, the facts will be improved in such a way that they are assembled in order and organized as a set.

Aside from the benefits that companies get from data cleansing services, there are also problems present in data cleansing. Sometimes, some data are lost because of the eradication of limited information. As for the companies that offer the services, they should maintain good service since data cleansing is expensive and time consuming.

Source: http://ezinearticles.com/?Importance-of-Data-Cleansing-Services&id=5013611

Thursday, 10 July 2014

Advantages of Medical Records Scanning

Medical records contain important and sensitive information regarding patients, such as birth and family records, illness, and other personal matters. Most hospitals have a certain section where doctors keep these files. They process many papers every day so they have to organize everything to avoid mistakes. There are instances, however, when calamities and accidents strike that lead to the loss of files. Papers are hard to recover once they get wet or burned. This is why many hospitals and medical facilities look for alternatives in keeping medical records.

Technology lets people make digital copies, which is useful for keeping different types of files. This adds to the flexibility of medical records as you can save photos and videos unlike the traditional word texts. Many hospitals use Electronic Medical Records or EMR to convert old documents to a digital format. This reduces the clutter in record sections as you only need a computer to keep different files. It also improves the efficiency of their staff as they do not have to spend significant time looking for a specific record.

Here are some of the advantages of medical records scanning:

Saves Space

Most hospitals need an entire room to keep all the records of their patients. Digital records, on the other hand, only require a corner of the room. Digital copies remove all the bulk in an area and create additional space. It is like shrinking an entire room to a hard drive by using medical records scanning. This makes the area look bigger and spacious. People can even use the new area for a more beneficial purpose.

Security

A disadvantage of keeping physical records is the risk of theft. The hospital is a busy place and many people go in and out every day. You cannot monitor everyone so it is hard to find the real culprit. This might cause information leak, exposing the patient's confidential information. The benefit of having digital copies is it has a system that monitors people who access it. It records what documents you take, edit, and delete. This increases the security and offers a peace of mind to your patients. You do not have to worry about losing the files either because they have a backup, making file recovery easy.

Lower Labor Costs

Many devices can perform tasks that require many people. This reduces the need of employing and paying more people to do the same job. It also saves time because you do not have to screen all the applicants. You can allot the money you save from labor costs for another thing.

Fewer Mistakes

Digital systems perform a task according to what you input so there is no room for mistakes. It ensures that all files are processed correctly. It saves you from problems due to paperwork mistakes. The hospital is a delicate environment and one mistake can risk the life of a patient. medical records scanning is a great way to improve the working process in hospitals and medical facilities. It reduces paperwork, increases security, and adds space. Try it now to see its benefits.

Source:http://ezinearticles.com/?Advantages-of-Medical-Records-Scanning&id=7466788

Wednesday, 9 July 2014

Web Data Extraction Services and Data Collection Form Website Pages

For any business market research and surveys plays crucial role in strategic decision making. Web scrapping and data extraction techniques help you find relevant information and data for your business or personal use. Most of the time professionals manually copy-paste data from web pages or download a whole website resulting in waste of time and efforts.

Instead, consider using web scraping techniques that crawls through thousands of website pages to extract specific information and simultaneously save this information into a database, CSV file, XML file or any other custom format for future reference.

Examples of web data extraction process include:

• Spider a government portal, extracting names of citizens for a survey
• Crawl competitor websites for product pricing and feature data
• Use web scraping to download images from a stock photography site for website design

Automated Data Collection

Web scraping also allows you to monitor website data changes over stipulated period and collect these data on a scheduled basis automatically. Automated data collection helps you discover market trends, determine user behavior and predict how data will change in near future.

Examples of automated data collection include:

• Monitor price information for select stocks on hourly basis
• Collect mortgage rates from various financial firms on daily basis
• Check whether reports on constant basis as and when required

Using web data extraction services you can mine any data related to your business objective, download them into a spreadsheet so that they can be analyzed and compared with ease.

In this way you get accurate and quicker results saving hundreds of man-hours and money!

With web data extraction services you can easily fetch product pricing information, sales leads, mailing database, competitors data, profile data and many more on a consistent basis.

Source: http://ezinearticles.com/?Web-Data-Extraction-Services-and-Data-Collection-Form-Website-Pages&id=4860417