Python-100-Days/Day61-65/code/example09.py

17 lines
377 B
Python

import robobrowser
def main():
b = robobrowser.RoboBrowser(parser='lxml')
b.open('https://github.com/login')
f = b.get_form(action='/session')
f['login'].value = 'jackfrued@gmail.com'
f['password'].value = 'yourpassword'
b.submit_form(f)
for a_tag in b.select('a[href]'):
print(a_tag.attrs['href'])
if __name__ == '__main__':
main()