So this is what the XML looks like when it spits it out except its a a lot of users...5820 users on one page and I need to create a "while" loop that will go thru every page. The only two tags I need are <alias> and <dtmfaccessid>
Ok. I will look at that. I appreciate it!
so I got the filter of XML tags sorted out with the following code...
Output:<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<html>
<body>
<users total="5820">
<user>
<firstname>Jane</firstname>
<lastname>Doe</lastname>
<alias>jDoe</alias>
<city></city>
<department>Accounting</department>
<employeeid></employeeid>
<displayname>Jane Doe</displayname>
<emailaddress>[email protected]</emailaddress>
<timezone>40</timezone>
<creationtime>2015-10-23T16:38:23Z</creationtime>
<listindirectory>true</listindirectory>
<isvmenrolled>false</isvmenrolled>
<dtmfaccessid>14734</dtmfaccessid>
<voicenamerequired>false</voicenamerequired>
</user>
</users>
</body>
</html>
(Apr-19-2018, 01:36 PM)snippsat Wrote:(Apr-19-2018, 01:08 PM)gentoobob Wrote: ok...so this works. It gives me a spit out of XML dataGood,one tips usecontent
,the will BeautifulSoup make to Unicode as it always do with all HTML/XML that's it take in
soup = BeautifulSoup(request_page.content, 'lxml')request_page.text is the content of the response in Unicode.
request_page.content is the content of the response in bytes.
So no point to convert to Unicode 2 times.
Ok. I will look at that. I appreciate it!
so I got the filter of XML tags sorted out with the following code...
alias = soup.find_all('alias') dtmfaccessid = soup.find_all('dtmfaccessid') for i in range(0, len(alias)): print(alias[i].get_text(), end=' ') print(dtmfaccessid[i].get_text())spits me out the two columns I need. Now just to do a while loop so it gets all 2000 users on each page and then puts this list into a CSV file with a time stamp.