Prevent XPath and CSS based scrapers by using markup randomization

Other Title(s)

منع جمع المعلومات بالطريقة المعتمدة على XPath و CSS باستخدام عشوائية الترميز

Dissertant

Diyab, Ahmad Mustafa Ibrahim

Thesis advisor

Barhum, Tawfiq Sulayman

University

Islamic University

Faculty

Faculty of Information Technology

Department

Information Technology

University Country

Palestine (Gaza Strip)

Degree

Master

Degree Date

2018

Arabic Abstract

كشط الويب - عملية جمع المعلومات بطريقة آلية من مواقع الانترنت - يمكن ان تستخدم بطريقة أخلاقية مثل التنبؤ بحالة الطقس أو حتى في البحث العلمي، ومن ناحية أخرى يمكن استخدامها بطريقة لا أخلاقية تعزز مبدئ انتهاك ملكية المحتوى وهذا يعتبر سرقة البيانات.

بعض الباحثين اقترحوا طرق عديدة لحل هذه المشكلة ولكن هذه الحلول لا يمكن ان تنهي هذه المشكلة بشكل كامل لأنها تطرقت للمشكلة بشكل جزئي أو في بعض أوقات تشغيل وليس كل أوقات تشغيل برنامج الكشط أو حتى حلول لا يمكن تطبيقها من أحدث معايير الويب الحديث.

على العكس تماما، طريقة جديدة لحل المشكلة تم طرحها في هذه الأطروحة لمنع مشكلة كشط الويب بشكل كافي وفعال مع أحدث معايير الويب هذه الطريقة ستبنى على مبدئ الترميز العشوائي للكود البرمجي والتي ستعمل على أعادة تسمية جميع قواعد الشكل CSS Rules وفي نفس الوقت تغييرها في الكود البرمجي الخاص بالصفحة " HTML Markup" ويمكن تطبيقها على كل صفحة من صفحات الموقع بسهولة وبدون قيود.

تم فحص هذا المقترح على عينة البيانات التي تم تجهزيها لتتلاءم من المقترح بحيث تتكون من 30 موقع الكتروني مختلف في الشكل موزعين على ثلاثة تصنيفات مواقع إخبارية مواقع العملات ومواقع حالات الطقس، وكان الهدف من التجارب هو فحص مدى تشابه الصفحة قبل وبعد تطبيق الطريقة المقترحة، وحجم التغيير على ملفات الكود البرمجي وأخيرا الوقت الإجمالي لتنفيذ الطريقة.

التشابه المرئي تم تفحصه باستخدام أدوات ذكية تفحص مدى تشابه الصفحات وأثبتت النتائج انه لا يوجد تغيير مرني في اغلب الحالات بحيث نسبة التشابه كانت 100% وفي بعض الحالات كانت نسبة التشابه وصلت الى %97 نتيجة لاحتواء الكود البرمجي الأصلي على بعض الرمز الغير مدعومة لأدوات الفحص وتعطي في كل مرة كود برمجة متخلف مثل إضافات فيسبوك.

التغير في حجم الملفات تم فحصة ومقارنته بما كان عليه وكانت النتائج تثبت ان حجم الملفات تقل بسبب عملية تحسين الكود البرمجي التي تتم اثناء تطبيق الطريقة المقترحة وفي بعض الحالات كانت هناك زيادة في حجم الملفات طبيعية بسبب ان الكود البرمجي الأصلي محسن ولا يوجد بده أي سطور برمجية غير ضرورية او اغير مرئية يمكن ازالتها.

الوقت الإجمالي لتطبيق الطريقة المقترحة يعتمد على حجم ملفات الكود البرمجي الأصلي، ففي حالات ان الكود البرمجي يحتوي على 4500 سطر فأكثر فان الوقت الإجمالي لتطبيق الطريقة يكون في حدود 5 دقائق، بينا ان الوقت اللازم لتطبيق الطريقة المقترحة في حالة اقل من 4500 سطر يكون اقل من دقيقتين.

English Abstract

Web Scraping is a useful technique can be used in an ethical way such as climate and many researching fields, on the other hand, unethical way such as exploit content privacy, which is Data Theft.

Several researchers have introduced some approaches for addressing this issue, these solutions could have solved the problem in partial ways or in some cases, therefore, the problem still needs another effort.

Consequently, in this work, a new solution is introduced for preventing web scraping based on XPath and CSS in an efficient way and applicable to modern web techniques.

The proposed solution will be based on Markup Randomization which will rename all CSS classes for a web page then sync those changes back with the HTML page.

The main advantage of the proposed solution that can be applied on any web page.

Experiments were done over collected dataset which consists of 30 websites divided into three categories: News, Currency Rates and Weather.

The aim of the experiments is to measure the Similarity, File Size and the processing time.

Visual Similarity was tested and proved that no visual changed occurred during and after applying the solution and most of comparing results were 100% and few results were above 97% due to some unsupported HTML tags was exists on the page such as tags with different namespace like Facebook plugins.

File size also changed during the process so some experiments showed that file size reduced due to unnecessary HTML elements removed and other increased due to the length of CSS classes’ length.

The processing time of applying the solution is related to file size so that the file with more than 4500 lines should take an average of 5 minutes while the file contains (0-4500) lines the processing time should be less than 2 minutes.

Main Subjects

Information Technology and Computer Science

Topics

No. of Pages

79

Table of Contents

Table of contents.

Abstract.

Abstract in Arabic.

Chapter One : Introduction.

Chapter Two : Theoretical background.

Chapter Three : Related works.

Chapter Four : Methodology

Chapter Five : Experiments and discussion.

Chapter Six : Conclusion.

References.

American Psychological Association (APA)

Diyab, Ahmad Mustafa Ibrahim. (2018). Prevent XPath and CSS based scrapers by using markup randomization. (Master's theses Theses and Dissertations Master). Islamic University, Palestine (Gaza Strip)
https://search.emarefa.net/detail/BIM-905195

Modern Language Association (MLA)

Diyab, Ahmad Mustafa Ibrahim. Prevent XPath and CSS based scrapers by using markup randomization. (Master's theses Theses and Dissertations Master). Islamic University. (2018).
https://search.emarefa.net/detail/BIM-905195

American Medical Association (AMA)

Diyab, Ahmad Mustafa Ibrahim. (2018). Prevent XPath and CSS based scrapers by using markup randomization. (Master's theses Theses and Dissertations Master). Islamic University, Palestine (Gaza Strip)
https://search.emarefa.net/detail/BIM-905195

Language

English

Data Type

Arab Theses

Record ID

BIM-905195