Oct-20-2019, 05:55 PM
Hi. I use this code
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | Cloudflare</title>
<meta id="captcha-bypass" name="captcha-bypass"/>
and a few more lines.
What happened? Why I can't get the source code with beautifulsoup?
Thank you
import requests from bs4 import BeautifulSoup pagina1="https://www.fragrantica.com/perfume/Chanel/Coco-Eau-de-Parfum-609.html" pagina1=requests.get(pagina1, headers = {'User-agent': 'your bot 0.1'}) soup=BeautifulSoup(pagina1.content,"html.parser") print(soup)the result is not the source code of the page but someting like
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>
<title>Attention Required! | Cloudflare</title>
<meta id="captcha-bypass" name="captcha-bypass"/>
and a few more lines.
What happened? Why I can't get the source code with beautifulsoup?
Thank you