CIT 383: Administrative Scripting

Slides:



Advertisements
Similar presentations
HTML Basic Lecture What is HTML? HTML (Hyper Text Markup Language) is a a standard markup language used for creating and publishing documents on.
Advertisements

Learning HTML. > Title of page This is my first homepage. Tells Browser This is an HTML page Basic Tags Tells Browser End of HTML page Header information.
WeB application development
 2003 Prentice Hall, Inc. All rights reserved. Chapter 4 - Introduction to XHTML: Part 1 Outline 4.1 Introduction 4.2 Editing XHTML 4.3 First XHTML Example.
 2004 Prentice Hall, Inc. All rights reserved. Introduction to XHTML: Part 1.
MGMT 230 Lab 1 HTML Basics. 2 HTML Tags An HTML document contains both document content and tags. The tags are the HTML codes inserted in a document to.
COMP101 – Exploring Multimedia and Internet Computing LA2 (Thu 14:00 – 16:50) TA: Jackie Lo.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting RSS.
 2003 Prentice Hall, Inc. All rights reserved. Chapter 4 - Introduction to XHTML: Part 1 Outline 4.1 Introduction 4.2 Editing XHTML 4.3 First XHTML Example.
HTML Presented by: Ondřej Procházka Course: Distributed Data Processing Mentor: Rafał Michalski.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting XML.
CS 299 – Web Programming and Design Introduction to HTML.
Extensible Hypertext Markup Language A successor to HTML 4.01 XML-compliant W3C is improving and expanding.
CIT 383: Administrative Scripting
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Introducing.
 2002 Prentice Hall, Inc. All rights reserved.2 Chapter 2 — Introduction to HyperText Markup Language 4: Part I Outline 2.1Introduction 2.2Markup Languages.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 2 Key Concepts 1 Copyright © Terry Felke-Morris.
INTRODUCTION. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language,
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Writing Methods.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Methods and Hashes.
1 Introduction to XHTML: Part 1 Outline Introduction Elements and Attributes Editing XHTML Common Elements W3C XHTML Validation Service Headers Linking.
HTML Basic. What is HTML HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language, it.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Regular Expressions.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting HTTP.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Numbers.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Directories.
CIT 383: Administrative Scripting
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting DateTime.
Introduction to information systems RUBY dr inż. Tomasz Pieciukiewicz.
CIT 383: Administrative ScriptingSlide #1 CIT 383: Administrative Scripting Commands.
HTML Help book. HTML HTML is the programming language used to make web pages for the Internet. HTML stands for Hyper Text Markup Language. HTML is made.
HTML Structure & syntax
Fall 2016 CSULA Saloni Chacha
Web Basics: HTML/CSS/JavaScript What are they?
HTML basics
Introduction to HTML.
Elements of HTML Web Design – Sec 3-2
Mansoor Ahmed Bughio.
HTML.
3.00cs HTML Overview 3.00cs Develop webpages.
CIT 383: Administrative Scripting
Introduction to XHTML.
Elements of HTML Web Design – Sec 3-2
HTML Vocabulary.
INP150: Basic HTML Instructor: Paul J. Millis
CIT 383: Administrative Scripting
CIT 383: Administrative Scripting
CIT 383: Administrative Scripting
Computers and Scientific Thinking David Reed, Creighton University
3.02D HTML Overview 3.02 Develop webpages.
CIT 383: Administrative Scripting
Marking Up with XHTML Tags describe how a web page should look
Basics of XHTML What Lies Beneath.
CIT 383: Administrative Scripting
Pertemuan 1b
HTML Basic Structure.
CIT 383: Administrative Scripting
HTML What is Html? HTML stands for Hypertext Markup Language.
Web Application Development
CIT 383: Administrative Scripting
CIT 383: Administrative Scripting
Pertemuan 1 Desain web Pertemuan 1
CIT 383: Administrative Scripting
3.02D HTML Overview 3.02 Develop webpages.
AN INTRODUCTION BY FAITH BRENNER
CIT 383: Administrative Scripting
CIT 383: Administrative Scripting
WJEC GCSE Computer Science
4.02A HTML Overview 4.02 Develop web pages using various layouts and technologies. (Note to instructor: HTML tags are in red only to differentiate from.
Creating your website and learning HTML
Presentation transcript:

CIT 383: Administrative Scripting HTML CIT 383: Administrative Scripting

CIT 383: Administrative Scripting Topics Evolution of HTML HTML Structure Regular Expressions v Parsing HPricot XPath CIT 383: Administrative Scripting

CIT 383: Administrative Scripting Evolution of HTML 1991 HTML created (only 22 tags) 1995 HTML 2.0 1996 Tables added to HTML 2.0 Jan 1997 HTML 3.2 published by W3C Dec 1997 HTML 4.0 2000 XHTML 1.0 2008 HTML 5.0 working draft published. CIT 383: Administrative Scripting

CIT 383: Administrative Scripting HTML Structure <html> <title>My title</title> <body> <a href=“...”>My link</a> <h1>My header</h1> </body> </html> CIT 383: Administrative Scripting

CIT 383: Administrative Scripting HTML Structure Image from http://www.w3schools.com/HTMLDOM/default.asp CIT 383: Administrative Scripting

Why Not Regular Expressions? Angle-bracket tags are difficult to deal with. Tag regexp: <\w+\s+[^>]*> Matches <img alt=“ruby” src=“rb.png”> Doesn’t: <img alt=“ruby>” src=“rb.png”> Solution:check for > in attributes. Have to match every form of attribute name=“value” name=‘value’ name=value name CIT 383: Administrative Scripting

CIT 383: Administrative Scripting Hpricot h = Hpricot(html-string) Creates a new HPricot::Doc object. el = h.at(string) Finds first matching Hpricot::Elements object. el = h.search(string or XPath expression) Returns array of matching objects. el.inner_html Returns HTML enclosed in element. CIT 383: Administrative Scripting

CIT 383: Administrative Scripting XPath Searches h.search("p") Find all paragraph tags in document. doc.search("/html/body//p") Find all paragraph tags within the body tag. doc.search("//a[@src]") Find all anchor tags with a src attribute. doc.search("//a[@src='google.com']") Find all a tags with a src attribute of google.com. http://code.whytheluckystiff.net/hpricot/wiki/SupportedXpathExpressions CIT 383: Administrative Scripting

CIT 383: Administrative Scripting References Michael Fitzgerald, Learning Ruby, O’Reilly, 2008. David Flanagan and Yukihiro Matsumoto, The Ruby Programming Language, O’Reilly, 2008. Hal Fulton, The Ruby Way, 2nd edition, Addison- Wesley, 2007. Robert C. Martin, Clean Code, Prentice Hall, 2008. Dave Thomas with Chad Fowler and Andy Hunt, Programming Ruby, 2nd edition, Pragmatic Programmers, 2005. CIT 383: Administrative Scripting