什么是内容抓取?|网页抓取

内容抓取或网页抓取是指机器人从网站上下载或"抓取"所有的内容,并通常为了恶意使用该内容。

学习目标

阅读本文后,您将能够:

  • 了解什么是内容抓取
  • 了解网页抓取机器人的工作原理
  • 阐释攻击者为何会抓取内容
  • 了解如何防止内容抓取

相关内容


想要继续学习吗?

订阅 TheNET,这是 Cloudflare 每月对互联网上最流行见解的总结!

参阅 Cloudflare 的隐私政策,了解我们如何收集和处理您的个人数据。

复制文章链接

什么是内容抓取?

内容抓取机器人

Content scraping, or web scraping, refers to when a bot downloads much or all of the content on a website, regardless of the website owner's wishes. Content scraping is a form of data scraping. that targets content, which includes anything from an original web graphic to a professional resume to a restaurant review. In most cases, scraping is carried out by automated bots that can gather information at mass scale and speed.

Content scraping can be used for legitimate purposes, such as aggregating data for search engine optimization. However, scraping bots are often used to repurpose content for malicious purposes, such as violating copyrights, duplicating the content for search engine optimization on websites owned by the attacker, and stealing organic traffic. These bots can also result in skewed usage analytics and exhausted server resources.

机器人如何抓取内容?

A website scraper bot will generally send a series of HTTP GET requests, then copy and save all the information that the web server sends in reply, making its way through the hierarchy of a website until it's copied all the content.

More sophisticated scraper bots can use JavaScript to, for instance, fill out every form on a website in order to access then download gated content. "Browser automation" programs and APIs allow automated bot interaction with websites and APIs as if they were using a traditional web browser in an attempt to trick the website’s server into thinking a human user is accessing the content.

Sure, an individual could manually copy and paste an entire website instead, but bots can crawl and download all of the content on a website in a matter of seconds, even for large e-commerce sites with hundreds or thousands of individual product pages.

What kinds of content do scraping bots target?

Bots can scrape anything posted publicly on the Internet – text, images, HTML code, CSS code, and so on. Attackers can then use the scraped data for a variety of purposes. One example is reusing text on another website to steal the first website's search engine ranking, or to deceive users. An attacker could also use a website's HTML and CSS code to duplicate the look of a legitimate website, or the branding of another company. Cyber criminals can use stolen content to create phishing websites that trick users into entering personal information by looking like the real version of another website.

Business pains caused by web scraping

There are several potential business harms that happen as a result of web scraping.

  • Price undercutting - competitors scrape my prices, undercut me, then take my sales. This affects any customer who is selling something, be it a product or a service.
  • Skewed business analytics affect planning - companies look to usage metrics as a factor in business decisions, especially around marketing, presentation, and where to dedicate further resources. Scrapers pollute this usage data.
  • Impaired website performance - exhaustive operations run by scrapers can cause websites to slow. In cases of egregious scraping, the customers’ servers may not be able to handle the traffic, making the site inaccessible to legitimate users. This is especially harmful to online retailers because it would prevent sales.
  • Added operational cost - the bandwidth used by scrapers can significantly escalate costs.
  • Users go elsewhere for my information - end-users can find the same information through an AI chatbot or another site, so the source of original information loses traffic. This is especially harmful to companies whose business models rely on paid subscriptions or ad revenue, notably news websites who only grant unlimited access to subscribed users or entertainment websites who heavily rely on ad views for revenue.

还有哪些其他类型的网页抓取?

价格抓取

Price scraping refers to when all of the pricing information on a website is downloaded, often by a competitor company. This can be harmful if the competitor adjusts their prices to make them more favorable, nudging consumers to buy from the competitor rather than the original (scraped) website.

联络信息抓取

Contact scraping refers to when a website is scanned for contact information, such as phone numbers and email addresses, then that information is downloaded.This kind of scraping often happens with the purpose of finding new targets for spam.

请参阅什么是数据抓取?以了解更多信息。

公司如何防止网页抓取?

Bot Management solutions can identify bot behavior patterns and mitigate bot scraping activities, often with the help of machine learning. Rate limiting can also help prevent content scraping: a real user is not likely to request the content of several hundred pages in a few seconds or minutes, and any "user" making requests that quickly is likely a bot. Additionally, introducing interstitial challenges that bots shouldn’t be able to solve can help distinguish real users from bots.

Protect against web scraping with Cloudflare

Cloudflare Bot Management protects your website from malicious bot traffic, designed to keep content scraping bots at bay. The machine-learning-based Cloudflare Bot Management can identify bots based on behavioral patterns, resulting in less friction for users and fewer false positives. For a robust mitigation approach to scraping, bot detection can work in combination with rate limiting requests and managing challenges with Turnstile.

Smaller organizations can also block scraping attacks and gain visibility into their bot traffic with Super Bot Fight Mode, available on Cloudflare Pro and Business plans.