Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="person-info">
- <div class="title ng-binding">Helen Brad in household of Geo Wilcock</div>
- <div class="subhead ng-scope ng-binding" data-ng-if="!recordPersonCentric">Canada Census, 1901</div>
- import urllib2
- import re
- import csv
- from bs4 import BeautifulSoup
- import time
- def get_FamSearch():
- link = "https://familysearch.org/pal:/MM9.1.1/KH21-21V"
- openLink = urllib2.urlopen(link)
- Soup_FamSearch = BeautifulSoup(openLink, "html")
- openLink.close()
- NameParentTag = Soup_FamSearch.find("tr", class_="result-item highlight-person")
- if NameParentTag:
- Name = NameParentTag.find("td", class_="result-value-bold").get_text(strip=True)
- name_decode = Name.encode("ascii", "ignore")
- print name_decode
- SubheadTag = Soup_FamSearch.find("div", class_="subhead ng-scope ng-binding")
- if SubheadTag:
- print SubheadTag.get_text(strip=True)
- get_FamSearch()
- Helen Brad
- [Finished in 2.2s]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement