Skip to content

Instantly share code, notes, and snippets.

@alexpodoff
Created November 26, 2016 15:58
Show Gist options
  • Save alexpodoff/1d9935f77819833aea028c627cb090d9 to your computer and use it in GitHub Desktop.
Save alexpodoff/1d9935f77819833aea028c627cb090d9 to your computer and use it in GitHub Desktop.
ыыы
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