Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Web scraping

From Wikipedia, the free encyclopedia
For broader coverage of this topic, seeData scraping.
Method of extracting data from websites
"Web scraper" redirects here. For websites that scrape content, seeScraper site.
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Web scraping" – news ·newspapers ·books ·scholar ·JSTOR
(April 2023) (Learn how and when to remove this message)

Web scraping,web harvesting, orweb data extraction isdata scraping used forextracting data fromwebsites.[1] Web scraping software may directly access theWorld Wide Web using theHypertext Transfer Protocol or a web browser. While web scraping can be done manually by a software user, the term typically refers to automated processes implemented using abot orweb crawler. It is a form of copying in which specific data is gathered and copied from the web, typically into a central localdatabase orspreadsheet, for laterretrieval oranalysis.

Scraping a web page involves fetching it and then extracting data from it. Fetching is the downloading of a page (which a browser does when a user views a page). Therefore, web crawling is a main component of web scraping, to fetch pages for later processing. Having fetched, extraction can take place. The content of a page may beparsed, searched and reformatted, and its data copied into a spreadsheet or loaded into a database. Web scrapers typically take something out of a page, to make use of it for another purpose somewhere else. An example would be finding and copying names and telephone numbers, companies and their URLs, or e-mail addresses to a list (contact scraping). Another example is collecting competitors’ product prices for marketing purposes.

Contact scraping is a type of web scraping that is used as a component of applications used forweb indexing,web mining anddata mining, online price change monitoring andprice comparison, product review scraping (to watch the competition), gathering real estate listings, weather data monitoring,website change detection, research, tracking online presence and reputation,web mashup, andweb data integration.

Web pages are built using text-basedmarkup languages (HTML andXHTML), and frequently contain a wealth of useful data in text form. However, most web pages are designed for humanend-users and not for ease of automated use. As a result, specialized tools and software have been developed to facilitate the scraping of web pages. Web scraping applications includemarket research, price comparison, content monitoring andartificial intelligence. Businesses rely on web scraping services to efficiently gather and utilize this data.

Newer forms of web scraping involve monitoringdata feeds fromweb servers. For example,JSON is commonly used as a transport mechanism between the client and the web server.

There are methods that some websites use to prevent web scraping, such as detecting and disallowing bots from crawling (viewing) their pages. In response, web scraping systems use techniques involvingDOM parsing,computer vision andnatural language processing to simulate human-like browsing to enable gathering web page content for offline parsing.

History

[edit]

After thebirth of the World Wide Web in 1989, the first web robot,[2]World Wide Web Wanderer, was created in June 1993, which was intended only to measure the size of the web.

In December 1993, the first crawler-based web search engine,JumpStation, was launched.[citation needed] As there were fewer websites available on the web, search engines at that time used to rely on human administrators to collect and format links. In comparison, Jump Station was the first WWW search engine to rely on a web robot.

In 2000, the first WebAPI andAPI crawler were created. In 2000,Salesforce andeBay launched their own API, with which programmers could access and download some of the data available to the public.[3] Since then, many websites offer web APIs for people to access their public database.

Techniques

[edit]
This sectioncontainsinstructions or advice. Wikipedia is not a guidebook; please helprewrite such content to be encyclopedic or move it toWikiversity,Wikibooks, orWikivoyage.(October 2025)

Data extraction techniques range from manual collection to sophisticated automated systems. Advanced methods analyze the underlying structure of web pages to transform unstructured content into amachine-readable format. These techniques utilizetext processing orartificial intelligence, aligning with the technical goals of theSemantic Web.

Human copy-and-paste

[edit]

The simplest form of web scraping is manual copying and pasting of data from a web page into a text file or spreadsheet. This approach requires no technical tools and can be used when automated scraping is blocked by website restrictions or when human judgment is necessary to interpret complex content. However, manual scraping is highly inefficient for large datasets, as it is time-consuming, prone to human error, and mentally exhausting. For this reason, it is generally considered impractical compared to automated methods, except in cases where automation is not feasible.

Text pattern matching

[edit]

A simple yet capable approach to extract information from web pages is to use the UNIXgrep command orregular expression-matching facilities of programming languages (for instancePerl orPython), in order to find text matching a specified pattern.

HTTP programming

[edit]

Static anddynamic web pages can be retrieved by posting HTTP requests to the remote web server usingsocket programming.

HTML parsing

[edit]

Many websites have large collections of pages generated dynamically from an underlying structured source like a database. Data of the same category are typically encoded into similar pages by a common script or template. In data mining, a program that detects such templates in a particular information source, extracts its content, and translates it into a relational form, is called awrapper. Wrapper generation algorithms assume that input pages of a wrapper induction system conform to a common template and that they can be easily identified in terms of a URL common scheme.[4] Moreover, somesemi-structured data query languages, such asXQuery and the HTQL, can be used to parse HTML pages and to retrieve and transform page content.

DOM parsing

[edit]
Further information:Document Object Model

By using a program such asSelenium orPlaywright, developers can control a web browser such asChrome orFirefox wherein they can load, navigate, and retrieve data from websites. This method can be especially useful for scraping data from dynamic sites since a web browser will fully load each page. Once an entire page is loaded, you can access and parse theDOM using an expression language such asXPath.

Vertical aggregation

[edit]

There are several companies that have developed vertical specific harvesting platforms. These platforms create and monitor a multitude of "bots" for specific verticals with no "man in the loop" (no direct human involvement), and no work related to a specific target site. The preparation involves establishing the knowledge base for the entire vertical and then the platform creates the bots automatically. The platform's robustness is measured by the quality of the information it retrieves (usually number of fields) and its scalability (how quick it can scale up to hundreds or thousands of sites). This scalability is mostly used to target theLong Tail of sites that common aggregators find complicated or too labor-intensive to harvest content from.

Semantic annotation recognizing

[edit]

The pages being scraped may embracemetadata or semantic markups and annotations, which can be used to locate specific data snippets. If the annotations are embedded in the pages, asMicroformat does, this technique can be viewed as a special case of DOM parsing. In another case, the annotations, organized into a semantic layer,[5] are stored and managed separately from the web pages, so the scrapers can retrieve data schema and instructions from this layer before scraping the pages.

Computer vision web-page analysis

[edit]

There are efforts usingmachine learning andcomputer vision that attempt to identify and extract information from web pages by interpreting pages visually as a human being might.[6]

Legal issues

[edit]
Globe icon.
The examples and perspective in this sectiondeal primarily with the United States and do not represent aworldwide view of the subject. You mayimprove this section, discuss the issue on thetalk page, or create a new section, as appropriate.(October 2015) (Learn how and when to remove this message)

The legality of web scraping varies across the world. In general, web scraping may be against theterms of service of some websites, but the enforceability of these terms is unclear.[7]

United States

[edit]

In the United States, website owners can use three majorlegal claims to prevent undesired web scraping: (1) copyright infringement (compilation), (2) violation of theComputer Fraud and Abuse Act ("CFAA"), and (3)trespass to chattel.[8] However, the effectiveness of these claims relies upon meeting various criteria, and the case law is still evolving. For example, with regard to copyright, while outright duplication of original expression will in many cases be illegal, in the United States the courts ruled inFeist Publications v. Rural Telephone Service that duplication of facts is allowable.

U.S. courts have acknowledged that users of "scrapers" or "robots" may be held liable for committingtrespass to chattels,[9][10] which involves a computer system itself being considered personal property upon which the user of a scraper is trespassing. The best known of these cases,eBay v. Bidder's Edge, resulted in an injunction ordering Bidder's Edge to stop accessing, collecting, and indexing auctions from the eBay web site. This case involved automatic placing of bids, known asauction sniping. However, in order to succeed on a claim of trespass tochattels, theplaintiff must demonstrate that thedefendant intentionally and without authorization interfered with the plaintiff's possessory interest in the computer system and that the defendant's unauthorized use caused damage to the plaintiff. Not all cases of web spidering brought before the courts have been considered trespass to chattels.[11]

One of the first major tests ofscreen scraping involvedAmerican Airlines (AA), and a firm called FareChase.[12] AA successfully obtained aninjunction from a Texas trial court, stopping FareChase from selling software that enables users to compare online fares if the software also searches AA's website. The airline argued that FareChase's websearch software trespassed on AA's servers when it collected the publicly available data. FareChase filed an appeal in March 2003. By June, FareChase and AA agreed to settle and the appeal was dropped.[13]

Southwest Airlines has also challenged screen-scraping practices, and has involved both FareChase and another firm, Outtask, in a legal claim. Southwest Airlines charged that the screen-scraping is Illegal since it is an example of "Computer Fraud and Abuse" and has led to "Damage and Loss" and "Unauthorized Access" of Southwest's site. It also constitutes "Interference with Business Relations", "Trespass", and "Harmful Access by Computer". They also claimed that screen-scraping constitutes what is legally known as "Misappropriation and Unjust Enrichment", as well as being a breach of the web site's user agreement. Outtask denied all these claims, claiming that the prevailing law, in this case, should beUS Copyright law and that under copyright, the pieces of information being scraped would not be subject to copyright protection. Although the cases were never resolved in theSupreme Court of the United States, FareChase was eventually shuttered by parent companyYahoo!, and Outtask was purchased by travel expense company Concur.[14]In 2012, a startup called 3Taps scraped classified housing ads from Craigslist. Craigslist sent 3Taps a cease-and-desist letter and blocked their IP addresses and later sued, inCraigslist v. 3Taps. The court held that the cease-and-desist letter and IP blocking was sufficient for Craigslist to properly claim that 3Taps had violated theComputer Fraud and Abuse Act (CFAA).

Although these are early scraping decisions, and the theories of liability are not uniform, it is difficult to ignore a pattern emerging that the courts are prepared to protect proprietary content on commercial sites from uses which are undesirable to the owners of such sites. However, the degree of protection for such content is not settled and will depend on the type of access made by the scraper, the amount of information accessed and copied, the degree to which the access adversely affects the site owner's system and the types and manner of prohibitions on such conduct.[15]

While the law in this area becomes more settled, entities contemplating using scraping programs to access a public web site should also consider whether such action is authorized by reviewing the terms of use and other terms or notices posted on or made available through the site. InCvent Inc. v.Eventbrite Inc. (2010), the United Statesdistrict court for the eastern district of Virginia, ruled that the terms of use should be brought to the users' attention in order for abrowsewrap contract or license to be enforceable.[16] In a 2014 case, filed in theUnited States District Court for the Eastern District of Pennsylvania,[17] e-commerce siteQVC objected to the Pinterest-like shopping aggregator Resultly's 'scraping of QVC's site for real-time pricing data. QVC alleges that Resultly "excessively crawled" QVC's retail site (allegedly sending 200-300 search requests to QVC's website per minute, sometimes to up to 36,000 requests per minute) which caused QVC's site to crash for two days, resulting in lost sales for QVC.[18] QVC's complaint alleges that the defendant disguised its web crawler to mask its source IP address and thus prevented QVC from quickly repairing the problem. This is a particularly interesting scraping case because QVC is seeking damages for the unavailability of their website, which QVC claims was caused by Resultly.

In the plaintiff's web site during the period of this trial, the terms of use link are displayed among all the links of the site, at the bottom of the page as most sites on the internet. This ruling contradicts the Irish ruling described below. The court also rejected the plaintiff's argument that the browse-wrap restrictions were enforceable in view of Virginia's adoption of the Uniform Computer Information Transactions Act (UCITA)—a uniform law that many believed was in favor on common browse-wrap contracting practices.[19]

InFacebook, Inc. v. Power Ventures, Inc., a district court ruled in 2012 that Power Ventures could not scrape Facebook pages on behalf of a Facebook user. The case is on appeal, and theElectronic Frontier Foundation filed a brief in 2015 asking that it be overturned.[20][21] InAssociated Press v. Meltwater U.S. Holdings, Inc., a court in the US held Meltwater liable for scraping and republishing news information from the Associated Press, but a court in the United Kingdom held in favor of Meltwater.

TheNinth Circuit ruled in 2019 that web scraping did not violate the CFAA inhiQ Labs v. LinkedIn. The case was appealed to theUnited States Supreme Court, which returned the case to the Ninth Circuit to reconsider the case in light of the 2021 Supreme Court decision inVan Buren v. United States which narrowed the applicability of the CFAA.[22] On this review, the Ninth Circuit upheld their prior decision.[23]

Internet Archive collects and distributes a significant number of publicly available web pages without being considered to be in violation of copyright laws.[citation needed]

European Union

[edit]

In February 2006, theDanish Maritime and Commercial Court (Copenhagen) ruled that systematic crawling, indexing, and deep linking by portal site ofir.dk of real estate site Home.dk does not conflict with Danish law or the database directive of the European Union.[24]

Ethical data scraping supports offmarket sourcing in business but must comply with GDPR to avoid privacy violations in automated data collection.[25]

In a February 2010 case complicated by matters of jurisdiction, Ireland's High Court delivered a verdict that illustrates theinchoate state of developing case law. In the case ofRyanair Ltd v Billigfluege.de GmbH, Ireland's High Court ruledRyanair's "click-wrap" agreement to be legally binding. In contrast to the findings of the United States District Court Eastern District of Virginia and those of the Danish Maritime and Commercial Court, JusticeMichael Hanna ruled that the hyperlink to Ryanair's terms and conditions was plainly visible, and that placing the onus on the user to agree to terms and conditions in order to gain access to online services is sufficient to comprise a contractual relationship.[26] The decision is under appeal in Ireland's Supreme Court.[27]

On April 30, 2020, the French Data Protection Authority (CNIL) released new guidelines on web scraping.[28] The CNIL guidelines made it clear that publicly available data is still personal data and cannot be repurposed without the knowledge of the person to whom that data belongs.[29]

Australia

[edit]

In Australia, theSpam Act 2003 outlaws some forms of web harvesting, although this only applies to email addresses.[30][31]

India

[edit]

Leaving a few cases dealing with IPR infringement, Indian courts have not expressly ruled on the legality of web scraping. However, since all common forms of electronic contracts are enforceable in India, violating the terms of use prohibiting data scraping will be a violation of the contract law. It will also violate theInformation Technology Act, 2000, which penalizes unauthorized access to a computer resource or extracting data from a computer resource.

Methods to prevent web scraping

[edit]

The administrator of a website can use various measures to stop or slow a bot. Some techniques include:

  • Blocking anIP address either manually or based on criteria such asgeolocation andDNSRBL. This will also block all browsing from that address.
  • Disabling anyweb serviceAPI that the website's system might expose.
  • Bots sometimes declare who they are (usinguser agentstrings) and can be blocked on that basis usingrobots.txt; 'googlebot' is an example. Other bots make no distinction between themselves and a human using a browser.
  • Bots can be blocked by monitoring excess traffic.
  • Bots can sometimes be blocked with tools to verify that it is a real person accessing the site, like aCAPTCHA. Bots are sometimes coded to explicitly break specific CAPTCHA patterns or may employ third-party services that utilize human labor to read and respond in real-time to CAPTCHA challenges. They can be triggered because the bot is: 1) making too many requests in a short time, 2) using low-quality proxies, or 3) not covering the web scraper’s fingerprint properly.[32]
  • Commercial anti-bot services: Companies offer anti-bot and anti-scraping services for websites. A few webapplication firewalls have limited bot detection capabilities as well. However, many such solutions are not very effective.[33]
  • Locating bots with ahoneypot or other method to identify the IP addresses of automated crawlers.
  • Obfuscation usingCSS sprites to display such data as telephone numbers or email addresses, at the cost ofaccessibility toscreen reader users.
  • Because bots rely on consistency in the front-end code of a target website, adding small variations to the HTML/CSS surrounding important data and navigation elements would require more human involvement in the initial set up of a bot and if done effectively may render the target website too difficult to scrape due to the diminished ability to automate the scraping process.[34]
  • Websites can declare if crawling is allowed or not in therobots.txt file and allow partial access, limit the crawl rate, specify the optimal time to crawl and more.
  • Trapping bots in atarpit, feeding them nonsensical data topoison their dataset. This method is particularly effective against bots which ignore robots.txt files.[35]
  • TLS Fingerprinting: Modern security systems analyze theTransport Layer Security (TLS) handshake to identify the client application. Different clients (e.g.,Google Chrome vs. aPython script) sendcryptographic ciphers and extensions in unique orders. This creates a unique "fingerprint" (such as a JA3 signature) that allows servers to detect and block automated scripts regardless of theirIP address.[36][37]

See also

[edit]

References

[edit]
  1. ^Thapelo, Tsaone Swaabow; Namoshe, Molaletsa; Matsebe, Oduetse; Motshegwa, Tshiamo; Bopape, Mary-Jane Morongwa (2021-07-28)."SASSCAL WebSAPI: A Web Scraping Application Programming Interface to Support Access to SASSCAL's Weather Data".Data Science Journal.20 24.doi:10.5334/dsj-2021-024.ISSN 1683-1470.S2CID 237719804.
  2. ^"Search Engine History.com".Search Engine History. RetrievedNovember 26, 2019.
  3. ^"eBay, API's, and the Connected Web".THE HISTORY OF THE WEB. 3 September 1995. RetrievedJune 23, 2025.
  4. ^Song, Ruihua; Microsoft Research (Sep 14, 2007)."Joint optimization of wrapper generation and template detection"(PDF).Proceedings of the 13th ACM SIGKDD international conference on Knowledge discovery and data mining. p. 894.doi:10.1145/1281192.1281287.ISBN 9781595936097.S2CID 833565. Archived fromthe original(PDF) on October 11, 2016.
  5. ^Semantic annotation based web scraping
  6. ^Roush, Wade (2012-07-25)."Diffbot Is Using Computer Vision to Reinvent the Semantic Web".Xconomy. www.xconomy.com. Retrieved2013-03-15.
  7. ^"FAQ about linking – Are website terms of use binding contracts?". www.chillingeffects.org. 2007-08-20. Archived fromthe original on 2002-03-08. Retrieved2007-08-20.
  8. ^Kenneth, Hirschey, Jeffrey (2014-01-01)."Symbiotic Relationships: Pragmatic Acceptance of Data Scraping".Berkeley Technology Law Journal.29 (4).doi:10.15779/Z38B39B.ISSN 1086-3818.{{cite journal}}: CS1 maint: multiple names: authors list (link)
  9. ^"Internet Law, Ch. 06: Trespass to Chattels". www.tomwbell.com. 2007-08-20. Retrieved2007-08-20.
  10. ^"What are the "trespass to chattels" claims some companies or website owners have brought?". www.chillingeffects.org. 2007-08-20. Archived fromthe original on 2002-03-08. Retrieved2007-08-20.
  11. ^"Ticketmaster Corp. v. Tickets.com, Inc". 2007-08-20. Retrieved2007-08-20.
  12. ^"American Airlines v. FareChase"(PDF). 2007-08-20. Archived fromthe original(PDF) on 2011-07-23. Retrieved2007-08-20.
  13. ^"American Airlines, FareChase Settle Suit". The Free Library. 2003-06-13. Archived fromthe original on 2016-03-05. Retrieved2012-02-26.
  14. ^Imperva (2011).Detecting and Blocking Site Scraping Attacks. Imperva white paper.
  15. ^Adler, Kenneth A. (2003-07-29)."Controversy Surrounds 'Screen Scrapers': Software Helps Users Access Web Sites But Activity by Competitors Comes Under Scrutiny". Archived fromthe original on 2011-02-11. Retrieved2010-10-27.
  16. ^"CVENT, Inc. v. Eventbrite, Inc.,et al"(PDF). 2014-11-24. Archived fromthe original(PDF) on 2013-09-21. Retrieved2015-11-05.
  17. ^"QVC Inc. v. Resultly LLC, No. 14-06714 (E.D. Pa. filed Nov. 24, 2014)".United States District Court for the Eastern District of Pennsylvania. Retrieved5 November 2015.
  18. ^Neuburger, Jeffrey D (5 December 2014)."QVC Sues Shopping App for Web Scraping That Allegedly Triggered Site Outage".The National Law Review. Proskauer Rose LLP. Retrieved5 November 2015.
  19. ^"Did Iqbal/Twombly Raise the Bar for Browsewrap Claims?"(PDF). 2010-09-17. Archived fromthe original(PDF) on 2011-07-23. Retrieved2010-10-27.
  20. ^"Can Scraping Non-Infringing Content Become Copyright Infringement... Because Of How Scrapers Work? | Techdirt".Techdirt. 2009-06-10. Retrieved2016-05-24.
  21. ^"Facebook v. Power Ventures".Electronic Frontier Foundation. July 2011. Retrieved2016-05-24.
  22. ^Chung, Andrew (June 14, 2021)."U.S. Supreme Court revives LinkedIn bid to shield personal data".Reuters. RetrievedJune 14, 2021.
  23. ^Whittaker, Zack (18 April 2022)."Web scraping is legal, US appeals court reaffirms".TechCrunch.
  24. ^"UDSKRIFT AF SØ- & HANDELSRETTENS DOMBOG"(PDF) (in Danish). bvhd.dk. 2006-02-24. Archived fromthe original(PDF) on 2007-10-12. Retrieved2007-05-30.
  25. ^"AI Act | Shaping Europe's digital future".digital-strategy.ec.europa.eu. 2025-09-16. Retrieved2025-09-28.
  26. ^"High Court of Ireland Decisions >> Ryanair Ltd -v- Billigfluege.de GMBH 2010 IEHC 47 (26 February 2010)". British and Irish Legal Information Institute. 2010-02-26. Retrieved2012-04-19.
  27. ^Matthews, Áine (June 2010)."Intellectual Property: Website Terms of Use".Issue 26: June 2010. LK Shields Solicitors Update. p. 03. Archived fromthe original on 2012-06-24. Retrieved2012-04-19.
  28. ^"La réutilisation des données publiquement accessibles en ligne à des fins de démarchage commercial | CNIL".www.cnil.fr (in French). Retrieved2020-07-05.
  29. ^FindDataLab.com (2020-06-09)."Can You Still Perform Web Scraping With The New CNIL Guidelines?".Medium. Retrieved2020-07-05.
  30. ^National Office for the Information Economy (February 2004)."Spam Act 2003: An overview for business". Australian Communications Authority. p. 6. Archived fromthe original on 2019-12-03. Retrieved2017-12-07.
  31. ^National Office for the Information Economy (February 2004)."Spam Act 2003: A practical guide for business"(PDF). Australian Communications Authority. p. 20. Retrieved2017-12-07.
  32. ^"Web Scraping for Beginners: A Guide 2024".Proxyway. 2023-08-31. Retrieved2024-03-15.
  33. ^Mayank DhimanBreaking Fraud & Bot Detection SolutionsOWASP AppSec Cali' 2018 Retrieved February 10, 2018.
  34. ^"What is web scraping?".DataDome. 2022-03-06. Retrieved2025-12-16.
  35. ^Belanger, Ashley (28 January 2025)."AI haters build tarpits to trap and trick AI scrapers that ignore robots.txt".Ars Technica.
  36. ^"JA3 - A method for profiling SSL/TLS Clients". Salesforce Engineering. Retrieved2026-01-27.
  37. ^Ermakovich, Sergey."What Is Web Scraping?".HasData. Retrieved2026-01-27.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Web_scraping&oldid=1336770093"
Category:
Hidden categories:

[8]ページ先頭

©2009-2026 Movatter.jp