Code Monkey home page Code Monkey logo

smart-xml-analyzer's Introduction

SmartXMLAnalyzer

Prerequisites

  • python3
  • BeautifulSoup
  • FuzzyWuzzy

Installing Needed Dependencies

pip install beautifulsoup4
pip install fuzzywuzzy
pip install python-Levenshtein

Starting the application:

python3 main.py <input_origin_file_path> <input_other_sample_file_path> <original_element_id>

Test cases with provided output results

python3 main.py examples/sample-0-origin.html examples/sample-1-evil-gemini.html make-everything-ok-button

Original tag attribute values : {'class': 'btn btn-success', 'title': 'Make-Button', 'href': '#ok', 'text': 'Make everything OK'}
Path to the most similar tag in diff_case : [document] > html > body > div > div > div > div > div > div > a 
Tag attribute values : {'class': 'btn btn-success', 'title': 'Make-Button', 'href': '#check-and-ok', 'text': 'Make everything OK'}
Similarity per tag attribute : {'class': 100, 'title': 100, 'href': 29, 'text': 100}
Final similarity score : (82.25,)

python3 main.py examples/sample-0-origin.html examples/sample-2-container-and-clone.html make-everything-ok-button

Original tag attribute values : {'class': 'btn btn-success', 'title': 'Make-Button', 'href': '#ok', 'text': 'Make everything OK'}
Path to the most similar tag in diff_case : [document] > html > body > div > div > div > div > div > div > div > a 
Tag attribute values : {'class': 'btn test-link-ok', 'title': 'Make-Button', 'href': '#ok', 'text': 'Make everything OK'}
Similarity per tag attribute : {'class': 52, 'title': 100, 'href': 100, 'text': 100}
Final similarity score : (88.0,)

python3 main.py examples/sample-0-origin.html examples/sample-3-the-escape.html make-everything-ok-button

Original tag attribute values : {'class': 'btn btn-success', 'title': 'Make-Button', 'href': '#ok', 'text': 'Make everything OK'}
Path to the most similar tag in diff_case : [document] > html > body > div > div > div > div > div > div > a 
Tag attribute values : {'class': 'btn btn-success', 'title': 'Do-Link', 'href': '#ok', 'text': 'Do anything perfect'}
Similarity per tag attribute : {'class': 100, 'title': 33, 'href': 100, 'text': 43}
Final similarity score : (69.0,)

python3 main.py examples/sample-0-origin.html examples/sample-4-the-mash.html make-everything-ok-button

Original tag attribute values : {'class': 'btn btn-success', 'title': 'Make-Button', 'href': '#ok', 'text': 'Make everything OK'}
Path to the most similar tag in diff_case : [document] > html > body > div > div > div > div > div > div > a 
Tag attribute values : {'class': 'btn btn-success', 'title': 'Make-Button', 'href': '#ok', 'text': 'Do all GREAT'}
Similarity per tag attribute : {'class': 100, 'title': 100, 'href': 100, 'text': 20}
Final similarity score : (80.0,)

smart-xml-analyzer's People

Contributors

voltron995 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.