Created
November 26, 2016 15:58
-
-
Save alexpodoff/1d9935f77819833aea028c627cb090d9 to your computer and use it in GitHub Desktop.
ыыы
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def is_there(self, part, s): | |
if part in s: | |
return re.search(part + " (.*)", s).group(1) | |
else: | |
return None | |
def get_contact_from_view_page(self, index): | |
wd = self.app.wd | |
self.open_contact_view_page_by_index(index) | |
text = wd.find_element_by_id("content").text | |
home = self.is_there("H:", text) | |
mobile = self.is_there("M:", text) | |
work = self.is_there("W:", text) | |
phone2 = self.is_there("P:", text) | |
return Contact(home=home, mobile=mobile, work=work, phone2=phone2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment