Finishing Regular Expressions XML / Web Scraping

Finishing Regular Expressions

&

XML / Web Scraping

Nov 10 2015

CSCI 0931 - Intro. to Comp. for the Humanities and Social Sciences

1

Today

?

?

?

?

Iterators

Do ACT 3-2

Finish Regular Expressions

XML Parsing in Python

CSCI 0931 - Intro. to Comp. for the Humanities and Social Sciences

2

Data Structures

Lists

content

indices

¡®a¡¯

¡®b¡¯

¡®c¡¯

¡®d¡¯

¡®e¡¯

¡®f¡¯

¡®g¡¯

¡®h¡¯

¡®i¡¯

¡®j¡¯

0

1

2

3

4

5

6

7

8

9

Dictionaries

¡®Alice¡¯ -> ¡®401-111-1111¡¯

¡®Carol¡¯ -> ¡®401-333-3333¡¯

keys & values

¡®Bob¡¯ -> ¡®401-222-2222¡¯

Iterators

Match Objects

Match

1

Match

2

Match

3

CSCI 0931 - Intro. to Comp. for the Humanities and Social Sciences

? Matched String

Match ? Matched String Start

4

? Matched String End

3

Iterators

The cat in the hat sat on a mat

Regular Expression:¡®\wat¡¯

CSCI 0931 - Intro. to Comp. for the Humanities and Social Sciences

4

Iterators

The cat in the hat sat on a mat

Regular Expression:¡®\wat¡¯

Iterator

Match

1

CSCI 0931 - Intro. to Comp. for the Humanities and Social Sciences

5

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download