How to put the right tags in Python?

Good day!

Faced with such a problem.

There is a small Python script that can login to the website(facebook) and searches.

Task:
You need to put the answer which is obtained from facebook.com in response, what I get is all I need tags, but when using bs4 I have None, and similarly when using the module lxml

The script itself:
#!/usr/bin/python3

import requests, re
from bs4 import BeautifulSoup

url = 'https://www.facebook.com/login.php'
data = {"email":"login", "pass":"passwd"}
query = 'Nikolai Sobolev'
session = requests.Session()
authority = session.post(url, data=data)
search = session.get('https://www.facebook.com/search/str/{kay}/keywords_users'.format(kay=query))
content = search.text

soup = BeautifulSoup(content, 'lxml')
film_list = soup.find('div', {'class': ['_4-u2 _58b7 _4i6x _4-u8']})
print(film_list)
June 8th 19 at 16:42
1 answer
June 8th 19 at 16:44
Solution
soup = BeautifulSoup(content, 'html5')
film_list = soup.select('div._4-u2._58b7._4i6x._4-u8')
print(film_list)
Thank you, I have a question maybe you know all the necessary details are in comments in tags comments there are unique tags for which to get the data but as I understand bs4't parse that-be in the comments.

Whether it is possible as that to bypass so to speak.

Here is an example code:

<!-- <ul class="uiList _4kg _54nz _4kt" data-pnref="about"><li><div class="_2pi0"><div class="clearfix"><div class="lfloat _ohe"><span class="_50f8 _50f4"><span class="_3i-4" id="u_0_31"><span class="addFriendText">To see what he shares with friends, <a class="addButton" href="#" role="button">send him a friend request.</a></span><span class="hidden_elem enableFriendListFlyout outgoingButton" data-profileid as="100020719010540">Request Sent.</span></span></span></div><div class="rfloat _ohf FriendButton" id="u_0_32"><button class="_42ft _4jy0 FriendRequestAdd addButton _4jy4 _4jy2 selected _51sy" aria-label="Add &#x41d;&#x438;&#x43a;&#x43e;&#x43b;&#x430;&#x439; &#x421;&#x43e;&#x431;&#x43e;&#x43b;&#x435;&#x432; as a friend" type="button"><i class="img _3-8_ sp_0mV_7Xb0M2r sx_cbefdc"></i>Add Friend</button><button class="_42ft _4jy0 FriendRequestOutgoing outgoingButton enableFriendListFlyout hidden_elem enableFriendListFlyout _4jy4 _4jy2 selected _51sy" data-flloc="escape_hatch" data-profileid as="100020719010540" type="button" data-cansuggestfriends="true" data-cancelref="profile" data-floc="profile_box"><i class="img _3-8_ sp_0mV_7Xb0M2r sx_cbefdc"></i>Friend Request Sent</button></div></div></div></li><li><div class="_5aj7"><div class="_4bl9"><div class="_54n - _2pi3"><div id="u_0_33"></div></div></div><div class="_4bl7"><div class="_4ms4" id="u_0_2x"><div class="clearfix _ikh _5c0g" data-pnref="overview" id="u_0_34"><div class="_4bl7"><ul class="uiList _4kg _6 _1pi3-h _703 _4ks"><li id="u_0_2y"><div class="clearfix _5y02" data-overviewsection="education" role="button" tabindex="0"><a class="_5uat _3-91 _8o lfloat _ohe" tabindex="-1" aria-hidden="true" href="https://www.facebook.com/pages/%D0%92%D0%B8%D0%B4%D0%B8%D0%BE%D0%B1%D0%BB%D0%BE%D0%B3%D0%B3%D0%B5%D1%80%D0%BE%D0%BC/105740766787633" data-hovercard="/ajax/hovercard/page.php?id=105740766787633" data-hovercard-prefer-more-content-show="1"><img class="_s0 _54ru img _4ooo" src="https://scontent-ams3-1.xx.fbcdn.net/v/t1.0-1/c9.0.32.32/p32x32/399548_10149999285987789_1102888142_n.png?oh=3f5eabccb0882ffd4fa8c378acb1f3d7&amp;oe=5B16CAAD" alt="" aria-label="&#x412;&#x438;&#x434;&#x438;&#x43e;&#x431;&#x43b;&#x43e;&#x433;&#x433;&#x435;&#x440;&#x43e;&#x43c;" role="img" /></a><div class="_42ef"><div class="_6a _6b _5u5j"><div class="_c24 _50f4">Works at <a class="profileLink" href="https://www.facebook.com/pages/%D0%92%D0%B8%D0%B4%D0%B8%D0%BE%D0%B1%D0%BB%D0%BE%D0%B3%D0%B3%D0%B5%D1%80%D0%BE%D0%BC/105740766787633" data-hovercard="/ajax/hovercard/page.php?id=105740766787633" data-hovercard-prefer-more-content-show="1">&#x412;&#x438;&#x434;&#x438;&#x43e;&#x431;&#x43b;&#x43e;&#x433;&#x433;&#x435;&#x440;&#x43e;&#x43c;</a> and <a class="profileLink" href="https://www.facebook.com/pages/%D0%92%D0%B8%D0%B4%D0%B8%D0%BE%D0%B1%D0%BB%D0%BE%D0%B3%D0%B3%D0%B5%D1%80/153749938511876"data-hovercard="/ajax/hovercard/page.php?id=153749938511876" data-hovercard-prefer-more-content-show="1">&#x412;&#x438;&#x434;&#x438;&#x43e;&#x431;&#x43b;&#x43e;&#x433;&#x433;&#x435;&#x440;</a></div></div></div></div></li><li class="_3pw9 _2pi4"><div class="clearfix _4bbo" role="button" tabindex="0"><div class="_5rsw _3-91 _8o lfloat _ohe"><i class="img _5rsx sp_yw06AF9sktb sx_4425aa"></i></div><div class="_42ef"><div class="_6a"><div class="_6a _6b" style="height:36px"></div><div class="_6a _6b"><span class="_50f8 _2iem">No schools to show</span></div></div></div></div></li><li id="u_0_2z"><div class="clearfix _5y02" data-overviewsection="places" role="button" tabindex="0"><a class="_5uat _3-91 _8o lfloat _ohe" tabindex="-1" aria-hidden="true" href="https://www.facebook.com/pages/Saint-Petersburg-Russia/108131085886116" data-hovercard="/ajax/hovercard/page.php?id=108131085886116" data-hovercard-prefer-more-content-show="1"><img class="_s0 _54ru img _4ooo" src="https://external-ams3-1.xx.fbcdn.net/safe_image.php?d=AQCQDsEUrvvBBbnD&amp;w=32&amp;h=32&amp;url=http%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fc%2Fcf%2FSPB_Collage_2014-3.png%2F720px-SPB_Collage_2014-3.png&amp;cfs=1&amp;fallback=hub_city&amp;f&amp;_nc_hash=AQBKnAUFwGo3Ecei" alt="" aria-label="Saint Petersburg, Russia" role="img" /></a><div class="_42ef"><div class="_6a _6b _5u5j"><div class="_c24 _50f4">Lives in <a class="profileLink" href="https://www.facebook.com/pages/Saint-Petersburg-Russia/108131085886116" data-hovercard="/ajax/hovercard/page.php?id=108131085886116" data-hovercard-prefer-more-content-show="1">Saint Petersburg, Russia</a></div><div><div><div class="_50f8 _2ieq"><div class="fsm fwn fcg"><span id="u_0_30">From <span class="fwb"><a class="profileLink" href="https://www.facebook.com/pages/Saint-Petersburg-Russia/108131085886116" data-hovercard="/ajax/hovercard/page.php?id=108131085886116" data-hovercard-prefer-more-content-show="1">Saint Petersburg, Russia</a></span></span></div></div></div></div></div></div></div></li><li class="_3pw9 _2pi4"><div class="clearfix _4bbo" role="button" tabindex="0"><div class="_5rsw _3-91 _8o lfloat _ohe"><i class="img _5rsx sp_yw06AF9sktb sx_585866"></i></div><div class="_42ef"><div class="_6a"><div class="_6a _6b" style="height:36px"></div><div class="_6a _6b"><span class="_50f8 _2iem">No relationship info to show</span></div></div></div></div></li></ul></div><div class="_4bl9 _zu9"><ul class="uiList _4kg _5yql" data-overviewsection="contact_basic" role="button" tabindex="0"></ul></div></div></div></div></div></li></ul> -->


Tried to pull out here so: pars = soup.find('ul', {'class': ['uiList _4kg _54nz _4kt']}) - nikita.Stracke commented on June 8th 19 at 16:47

Find more questions by tags Beautiful SoupParsingPython