Python Forum
How to read html tags dynamically generated?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read html tags dynamically generated?
#1
Hi!

I'm very newbie in Python and I would like to know how can I get/read a html code dynamically generated. I heard I can use PhantomJS but could you guys indicate me something else to?
Reply
#2
Could you please clarify exactly what your objective is?
Reply
#3
In the following code I'm trying to get the number 1151 from the span tag inside the span tag <span class="kno-fb-ctx _i2g">

The problem is the code isn't finding anything!

from bs4 import BeautifulSoup
import requests

url = "https://www.google.com.br/search?q=timemania"
source_code = requests.get(url)
plaint_text = source_code.text
soup = BeautifulSoup(plaint_text, 'html.parser')
div_balls = soup.findAll('span', {'class':'kno-fb-ctx _i2g'})

print(len(div_balls))
]]

The output is 0. Should be 1 i think.
Reply
#4
I modified the class that I wrote as a general download and scrape routine to work with your URL.
Feel free to use it if you wish.
It uses pathlib (python 3.4 or newer (prefer 3.6))
and it uses lxml:
pip install lxml
but it's setup to scrape the majority of web pages;
from bs4 import BeautifulSoup
from pathlib import Path
import requests
import time


class ScrapePage:
    def __init__(self, max_age_hours=168):
        self.max_file_age_hours = max_age_hours
        # default = 1 week
        self.ok_status = 200
        self.home = Path('.')

    def download_needed(self, filename):
        retval = True
        if filename.exists():
            stat = filename.stat()
            now = time.time()
            hours_old = int((now - stat.st_mtime) / 3600)
            if hours_old < self.max_file_age_hours:
                retval = False
        return retval

    def get_page(self, url, savefile='dummy.html'):
        psavefile = self.home / savefile
        if self.download_needed(psavefile):
            response = requests.get(url, allow_redirects=False)
            if response.status_code == self.ok_status:
                with psavefile.open('wb') as f:
                    f.write(response.content)
                return response.content
            else:
                print(f'Unable to load page, status: {response.status_code}')
                return None
        else:
            with psavefile.open('rb') as f:
                return f.read()

    def parse_page(self, url=None, savefile=None):
        page = self.get_page(url, savefile)
        soup = soup = BeautifulSoup(page, 'lxml')
        print(soup)
        div_balls = soup.findAll('span', {'class': 'kno-fb-ctx _i2g'})
        print('div_balls: {}'.format(div_balls))


def testit():
    # max_age_hours=0 will not use cache, will always get page from web
    sp = ScrapePage(max_age_hours=24) # use cache, get new every 24 hours
    test_url = "https://www.google.com.br/search?q=timemania"
    sp.parse_page(url=test_url, savefile='google_text.html')

if __name__ == '__main__':
    testit()
results
Output:
<!DOCTYPE html> <html itemscope="" itemtype="http://schema.org/SearchResultsPage" lang="en"><head><meta content="text/html; charset=utf-8" http-equiv="Content-Type"/><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"/><link href="/images/branding/product/ico/googleg_lodp.ico" rel="shortcut icon"/><title>timemania - Google Search</title><style>#gbar,#guser{font-size:13px;padding-top:1px !important;}#gbar{height:22px}#guser{padding-bottom:7px !important;text-align:right}.gbh,.gbd{border-top:1px solid #c9d7f1;font-size:1px}.gbh{height:0;position:absolute;top:24px;width:100%}@media all{.gb1{height:22px;margin-right:.5em;vertical-align:top}#gbar{float:left}}a.gb1,a.gb4{text-decoration:underline !important}a.gb1,a.gb4{color:#00c !important}.gbi .gb4{color:#dd8e27 !important}.gbf .gb4{color:#900 !important} </style><style>.star{float:left;margin-top:1px;overflow:hidden}._yhd{font-size:11px}.j{width:34em}body,td,div,.p,a{font-family:arial,sans-serif;tap-highlight-color:rgba(255,255,255,0)}body{margin:0}a img{border:0}#gbar{float:left;height:22px;padding-left:2px;font-size:13px}.gsfi,.gsfs{font-size:17px}.w,.q:active,.q:visited,.tbotu{color:#11c}a.gl{text-decoration:none}#foot{padding:0 8px}#foot a{white-space:nowrap}h3{font-size:16px;font-weight:normal;margin:0;padding:0}#res h3{display:inline}.hd{height:1px;position:absolute;top:-1000em}.g,body,html,table,.std{font-size:13px}.g{margin-bottom:23px;margin-top:0;zoom:1}ol li,ul li{list-style:none}h1,ol,ul,li{margin:0;padding:0}.e{margin:2px 0 0.75em}#leftnav a{text-decoration:none}#leftnav h2{color:#767676;font-weight:normal;margin:0}#nav{border-collapse:collapse;margin-top:17px;text-align:left}#nav td{text-align:center}.nobr{white-space:nowrap}.ts{border-collapse:collapse}.s br{display:none}.csb{display:block;height:40px}.images_table td{line-height:17px;padding-bottom:16px}.images_table img{border:1px solid #ccc;padding:1px}#tbd,#abd{display:block;min-height:1px}#abd{padding-top:3px}#tbd li{display:inline}._ITd,._JTd{margin-bottom:8px}#tbd .tbt li{display:block;font-size:13px;line-height:1.2;padding-bottom:3px;padding-left:8px;text-indent:-8px}.tbos,.b{font-weight:bold}em{font-weight:bold;font-style:normal}.mime{color:#1a0dab;font-weight:bold;font-size:x-small}.soc a{text-decoration:none}.soc{color:#808080}._kgd{color:#e7711b}#_vBb{border:1px solid #e0e0e0;margin-left:-8px;margin-right:-8px;padding:15px 20px 5px}._m3b{font-size:32px}._eGc{color:#777;font-size:16px;margin-top:5px}._H0d{color:#777;font-size:14px;margin-top:5px}._HLh{border:1px solid #e0e0e0;padding-left:20px}._Tki{border:1px solid #e0e0e0;padding:5px 20px}#vob{border:1px solid #e0e0e0;padding:15px 15px}#_Nyc{font-size:22px;line-height:22px;padding-bottom:5px}#vob_st{line-height:1.24}._Tsb{border-width:1px;border-style:solid;border-color:#eee;background-color:#fff;position:relative;margin-bottom:26px}._Peb,._Qeb,._Usb{font-family:Arial;font-weight:lighter}._Peb{margin-bottom:5px}._Peb{font-size:xx-large}._Qeb{font-size:medium}._Usb{font-size:small}._Tsb{margin-left:-8px;margin-right:-15px;padding:20px 20px 24px}._rOc{border-spacing:0px 2px}._sOc{max-width:380px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding-left:0px}._v9b{padding-left:15px;white-space:nowrap;color:#666}._pOc{padding-left:0px}._rkc{color:#212121}._HOb{color:#878787}._lMf{color:#093}._jMf{color:#c00}._kMf{padding:1px}._CKg{color:#dd4b39}.gssb_a{padding:0 10px !important}.gssb_c{left:132px !important;right:295px !important;top:78px !important;width:572px !important}.gssb_c table{font-size:16px !important}.gssb_e{border:1px solid #ccc !important;border-top-color:#d9d9d9 !important}.gssb_i{background:#eee !important}#res{padding:0 8px}#rhs_block{padding-top:43px}#_FQd{padding:0 8px}#subform_ctrl{font-size:11px;height:17px;margin:5px 3px 0 17px}.taf{padding-bottom:3px}._chd{padding:20px 0 3px}._bhd{padding:20px 0 3px}#topstuff .e{padding-bottom:6px}.slk .sld{width:250px}.slk{margin-bottom:-3px}.slk ._z3b{padding-bottom:5px;width:250px}.ac,.st{line-height:1.24}.mfr,#ofr{font-size:16px;margin:1em 0;padding:0 8px}._tLi{padding-bottom:25px}.s{color:#545454}.ac{color:#545454}a.fl,._cD a,.osl a{color:#1a0dab;text-decoration:none}a:link{color:#1a0dab;cursor:pointer}#tads a:link{color:#1a0dab}#tads .soc a:link{color:#808080}a:visited{color:#61C}.blg a{text-decoration:none}cite,cite a:link{color:#006621;font-style:normal}#tads cite{color:#006621}.kv{font-size:15px}.kvs{margin-top:1px}.kv,.kvs,.slp{display:block;margin-bottom:1px}.kt{border-spacing:2px 0;margin-top:1px}.f{color:#808080}._pJb{color:#093}h4.r{display:inline;font-size:small;font-weight:normal}.g{line-height:1.2}._sPb{display:inline-block;vertical-align:top;overflow:hidden;position:relative}._Gnc{margin:0 0 2em 1.3em}._Gnc li{list-style-type:disc}.osl{color:#777;margin-top:4px}.r{font-size:16px;margin:0}.spell{font-size:16px}.spell_orig{font-size:13px}.spell_orig a{text-decoration:none}.spell_orig b i{font-style:normal;font-weight:normal}.th{border:1px solid #ebebeb}.ts td{padding:0}.videobox{padding-bottom:3px}.slk a{text-decoration:none}#leftnav a:hover,#leftnav .tbou a:hover,.slk h3 a,a:hover{text-decoration:underline}#mn{table-layout:fixed;width:100%}#leftnav a{color:#222;font-size:13px}#leftnav{padding:43px 4px 4px 0}.tbos{color:#dd4b39}.tbt{margin-bottom:28px}#tbd{padding:0 0 0 16px}.tbou a{color:#222}#center_col{border:0;padding:0 8px 0 0}#topstuff .e{padding-top:3px}#topstuff .sp_cnt{padding-top:6px}#ab_name{color:#dd4b39;font:20px "Arial";margin-left:15px}#resultStats{color:#999;font-size:13px;overflow:hidden;white-space:nowrap}.mslg>td{padding-right:1px;padding-top:2px}.slk .sld{margin-top:2px;padding:5px 0 5px 5px}.fmp{padding-top:3px}.close_btn{overflow:hidden}#fll a,#bfl a{color:#1a0dab !important;margin:0 12px;text-decoration:none !important}.ng{color:#dd4b39}#mss{margin:.33em 0 0;padding:0;display:table}._mY{display:inline-block;float:left;white-space:nowrap;padding-right:16px}#mss p{margin:0;padding-top:5px}.tn{border-bottom:1px solid #ebebeb;display:block;float:left;height:59px;line-height:54px;min-width:980px;padding:0;position:relative;white-space:nowrap}._UXb,a._UXb{color:#777;cursor:pointer;display:inline-block;font-family:arial,sans-serif;font-size:small;height:54px;line-height:54px;margin:0 8px;padding:0 8px;text-decoration:none;white-space:nowrap}._Ihd{border-bottom:3px solid #dd4b39;color:#dd4b39;font-weight:bold;margin:2px 8px 0}a._Jhd:hover{color:black;text-decoration:none;white-space:nowrap}body{margin:0;padding:0}._sxc{display:inline-block;float:left;margin-top:2px}._Hhd,a._Hhd{margin-left:1px}.sd{line-height:43px;padding:0 8px 0 9px}a:active,.osl a:active,.tbou a:active,#leftnav a:active{color:#dd4b39}#bfl a:active{color:#dd4b39 !important}.csb{background:url(/images/nav_logo229.png) no-repeat;overflow:hidden}.close_btn{background:url(/images/nav_logo229.png) no-repeat -138px -84px;height:14px;width:14px;display:block}.star{background:url(/images/nav_logo229.png) no-repeat -94px -245px;height:13px;width:65px;display:block}.star div,.star span{background:url(/images/nav_logo229.png) no-repeat 0 -245px;height:13px;width:65px;display:block}._nBb{display:inline;margin:0 3px;outline-color:transparent;overflow:hidden;position:relative}._nBb>div{outline-color:transparent}._O0{border-color:transparent;border-style:solid dashed dashed;border-top-color:green;border-width:4px 4px 0 4px;cursor:pointer;display:inline-block;font-size:0;height:0;left:4px;line-height:0;outline-color:transparent;position:relative;top:-3px;width:0}._O0{margin-top:-4px}.am-dropdown-menu{display:block;background:#fff;border:1px solid #dcdcdc;font-size:13px;left:0;padding:0;position:absolute;right:auto;white-space:nowrap;z-index:3}._Ykb{list-style:none;white-space:nowrap}._Ykb:hover{background-color:#eee}a._Zkb{color:#333;cursor:pointer;display:block;padding:7px 18px;text-decoration:none}#tads a._Zkb{color:#333}.sfbgg{background:#f1f1f1;border-bottom:1px solid #e5e5e5;height:71px}#logocont{z-index:1;padding-left:4px;padding-top:4px}#logo{display:block;height:49px;margin-top:12px;margin-left:12px;overflow:hidden;position:relative;width:137px}#logo img{left:0;position:absolute;top:-41px}.lst-a{background:white;border:1px solid #d9d9d9;border-top-color:silver;width:570px}.lst-a:hover{border:1px solid #b9b9b9;border-top:1px solid #a0a0a0;box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.lst-td{border:none;padding:0}.tia input{border-right:none;padding-right:0}.tia{padding-right:0}.lst{background:none;border:none;color:#000;font:16px arial,sans-serif;float:left;height:22px;margin:0;padding:3px 6px 2px 9px;vertical-align:top;width:100%;word-break:break-all}.lst:focus{outline:none}.lst-b{background:none;border:none;height:26px;padding:0 6px 0 12px}.ds{border-right:1px solid #e7e7e7;position:relative;height:29px;margin-left:17px;z-index:100}.lsbb{background-image:-moz-linear-gradient(top,#4d90fe,#4787ed);background-image:-ms-linear-gradient(top,#4d90fe,#4787ed);background-image:-o-linear-gradient(top,#4d90fe,#4787ed);background-image:-webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#4787ed));background-image:-webkit-linear-gradient(top,#4d90fe,#4787ed);background-image:linear-gradient(top,#4d90fe,#4787ed);border:1px solid #3079ed;border-radius:2px;background-color:#4d90fe;height:27px;width:68px}.lsbb:hover{background-image:-moz-linear-gradient(top,#4d90fe,#357ae8);background-image:-ms-linear-gradient(top,#4d90fe,#357ae8);background-image:-o-linear-gradient(top,#4d90fe,#357ae8);background-image:-webkit-gradient(linear,left top,left bottom,from(#4d90fe),to(#357ae8));background-image:-webkit-linear-gradient(top,#4d90fe,#357ae8);background-color:#357ae8;background-image:linear-gradient(top,#4d90fe,#357ae8);border:1px solid #2f5bb7}.lsb{background:transparent;background-position:0 -343px;background-repeat:repeat-x;border:none;color:#000;cursor:default;font:15px arial,sans-serif;height:29px;margin:0;vertical-align:top;width:100%}.lsb:active{-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.3);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.3);box-shadow:inset 0 1px 2px rgba(0,0,0,0.3);background:transparent;color:transparent;overflow:hidden;position:relative;width:100%}.sbico{color:transparent;display:inline-block;height:15px;margin:0 auto;margin-top:2px;width:15px;overflow:hidden}</style><script nonce="RMsOTWgFbj7tftoaaaLSNA==">(function(){window.google={kEI:'NYucWp62FJKYsAW4krGACw',kEXPI:'1354276,1354915,1355218,1355457,1355675,1355762,1356040,1356180,1356779,1356854,1357034,1357219,1357452,1357718,3700255,3700521,4029815,4031109,4043492,4045841,4048347,4071907,4071911,4081038,4097153,4097922,4097929,4098733,4098740,4103845,4106085,4107294,4107914,4109316,4109489,4114597,4115697,4116279,4116926,4116927,4116935,4118798,4119032,4119034,4119036,4120660,4121175,4123645,4124726,4124850,4125837,4126203,4126754,4127086,4127418,4127744,4128586,4129001,4129520,4129633,4130362,4131247,4131834,4133509,4135025,4136073,4137467,4137597,4137646,4138996,4141707,4141915,4142071,4142328,4142834,4143278,4143676,4144233,4144442,4144544,4144704,4144803,4145088,4145461,4145485,4145772,4145836,4146146,4146442,4146873,4147031,4147900,4147943,4148268,4148280,4148304,4148399,4148571,4148608,4148874,4149039,4149271,4149304,4149336,4150005,4150017,4150429,4151014,4151017,4151049,4151052,4151295,4151368,4151407,4151697,4151767,4152458,4152459,4152618,4153062,4153222,4153239,4153545,4153550,4153952,4154020,4154043,4154081,4154189,4154374,4154506,4154871,4154945,4155569,4155614,4155684,4156010,4156147,4156181,4156454,4156516,4156634,4156657,4156663,4156699,4156706,4156877,4157025,4157382,4157405,4157642,4157890,4158184,4158208,4158222,10200083,10200096,10202524,10202571,41317155',authuser:0,kscs:'c9c918f0_NYucWp62FJKYsAW4krGACw',u:'c9c918f0',kGL:'US'};google.kHL='en';})();(function(){google.lc=[];google.li=0;google.getEI=function(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||google.kEI};google.getLEI=function(a){for(var b=null;a&&(!a.getAttribute||!(b=a.getAttribute("leid")));)a=a.parentNode;return b};google.https=function(){return"https:"==window.location.protocol};google.ml=function(){return null};google.wl=function(a,b){try{google.ml(Error(a),!1,b)}catch(d){}};google.time=function(){return(new Date).getTime()};google.log=function(a,b,d,c,g){if(a=google.logUrl(a,b,d,c,g)){b=new Image;var e=google.lc,f=google.li;e[f]=b;b.onerror=b.onload=b.onabort=function(){delete e[f]};google.vel&&google.vel.lu&&google.vel.lu(a);b.src=a;google.li=f+1}};google.logUrl=function(a,b,d,c,g){var e="",f=google.ls||"";d||-1!=b.search("&ei=")||(e="&ei="+google.getEI(c),-1==b.search("&lei=")&&(c=google.getLEI(c))&&(e+="&lei="+c));c="";!d&&google.cshid&&-1==b.search("&cshid=")&&(c="&cshid="+google.cshid);a=d||"/"+(g||"gen_204")+"?atyp=i&ct="+a+"&cad="+b+e+f+"&zx="+google.time()+c;/^http:/i.test(a)&&google.https()&&(google.ml(Error("a"),!1,{src:a,glmm:1}),a="");return a};}).call(this);(function(){google.y={};google.x=function(a,b){if(a)var c=a.id;else{do c=Math.random();while(google.y[c])}google.y[c]=[a,b];return!1};google.lm=[];google.plm=function(a){google.lm.push.apply(google.lm,a)};google.lq=[];google.load=function(a,b,c){google.lq.push([[a],b,c])};google.loadAll=function(a,b){google.lq.push([a,b])};}).call(this);google.f={};(function(){var b={gen204:"dcl",clearcut:4};var c=[function(){google.c&&google.tick("load",b)}];google.dcl=!1;google.dclc=function(a){google.dcl?a():c.push(a)};function d(){if(!google.dcl){google.dcl=!0;for(var a;a=c.shift();)a()}}window.addEventListener?(document.addEventListener("DOMContentLoaded",d,!1),window.addEventListener("load",d,!1)):window.attachEvent&&window.attachEvent("onload",d);}).call(this);</script><script nonce="RMsOTWgFbj7tftoaaaLSNA==" type="text/javascript"></script><script nonce="RMsOTWgFbj7tftoaaaLSNA==">(function(){google.sham=function(c){for(var d=c.parentElement,a=null,b=0;b<d.childNodes.length;b++){var e=d.childNodes[b];-1<(" "+e.className+" ").indexOf(" am-dropdown-menu ")&&(a=e)}"none"==a.style.display?(a.style.display="",google.log("hpam","&ved="+c.getAttribute("data-ved"))):a.style.display="none"};}).call(this);(function(){var a=[];google.jsc={xx:a,x:function(b){a.push(b)}};}).call(this);</script></head><body bgcolor="#ffffff" class="hsrp" marginheight="0" marginwidth="0" topmargin="0"><div id="gbar"><nobr><b class="gb1">Search</b> <a class="gb1" href="https://www.google.com/search?hl=en&amp;tbm=isch&amp;source=og&amp;tab=wi">Images</a> <a class="gb1" href="https://maps.google.com/maps?hl=en&amp;tab=wl">Maps</a> <a class="gb1" href="https://play.google.com/?hl=en&amp;tab=w8">Play</a> <a class="gb1" href="https://www.youtube.com/results?gl=US&amp;tab=w1">YouTube</a> <a class="gb1" href="https://news.google.com/nwshp?hl=en&amp;tab=wn">News</a> <a class="gb1" href="https://mail.google.com/mail/?tab=wm">Gmail</a> <a class="gb1" href="https://drive.google.com/?tab=wo">Drive</a> <a class="gb1" href="https://www.google.com/intl/en/options/" style="text-decoration:none"><u>More</u> »</a></nobr></div><div id="guser" width="100%"><nobr><span class="gbi" id="gbn"></span><span class="gbf" id="gbf"></span><span id="gbe"></span><a class="gb4" href="http://www.google.com/history/optout?hl=en">Web History</a> | <a class="gb4" href="/preferences?hl=en">Settings</a> | <a class="gb4" href="https://accounts.google.com/ServiceLogin?hl=en&amp;passive=true&amp;continue=https://www.google.com.br/search%3Fq%3Dtimemania" id="gb_70" target="_top">Sign in</a></nobr></div><div class="gbh" style="left:0"></div><div class="gbh" style="right:0"></div><table border="0" cellpadding="0" cellspacing="0" id="mn" style="position:relative"><tr><th width="132"></th><th width="573"></th><th width="278"></th><th></th></tr><tr><td class="sfbgg" valign="top"><div id="logocont"><h1><a href="/webhp?hl=en" id="logo" style="background:url(/images/nav_logo229.png) no-repeat 0 -41px;height:37px;width:95px;display:block" title="Go to Google Home"></a></h1></div></td><td class="sfbgg" colspan="2" style="padding-left:0px" valign="top"><form action="/search" id="tsf" method="GET" name="gs" style="display:block;margin:0;background:none"><table border="0" cellpadding="0" cellspacing="0" style="margin-top:20px;position:relative"><tr><td><div class="lst-a"><table cellpadding="0" cellspacing="0"><tr><td class="lst-td" valign="bottom" width="555"><div style="position:relative;zoom:1"><input autocomplete="off" class="lst" id="sbhost" maxlength="2048" name="q" title="Search" type="text" value="timemania"/></div></td></tr></table></div></td><td><div class="ds"><div class="lsbb"><button class="lsb" name="btnG" type="submit" value="Search"><span class="sbico" style="background:url(/images/nav_logo229.png) no-repeat -36px -111px;height:14px;width:13px;display:block"></span></button></div></div></td></tr></table></form></td><td class="sfbgg"> </td></tr><tr style="position:relative"><td><div style="border-bottom:1px solid #ebebeb;height:59px"></div></td><td colspan="2"><div class="tn"><div class="_UXb _Ihd _sxc _Hhd">All</div><div class="_sxc"><a class="_UXb _Jhd" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnms&amp;tbm=isch&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ_AUIBQ">Images</a></div><div class="_sxc"><a class="_UXb _Jhd" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnms&amp;tbm=vid&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ_AUIBg">Videos</a></div><div class="_sxc"><a class="_UXb _Jhd" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnms&amp;tbm=nws&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ_AUIBw">News</a></div><div class="_sxc"><a class="_UXb _Jhd" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnms&amp;tbm=shop&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ_AUICA">Shopping</a></div><div class="_sxc"><a class="_UXb _Jhd" href="https://maps.google.com.br/maps?q=timemania&amp;um=1&amp;ie=UTF-8&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ_AUICQ">Maps</a></div><div class="_sxc"><a class="_UXb _Jhd" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnms&amp;tbm=bks&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ_AUICg">Books</a></div></div><div style="border-bottom:1px solid #ebebeb;height:59px"></div></td><td><div style="border-bottom:1px solid #ebebeb;height:59px"></div></td></tr><tbody id="desktop-search"><style>._Bu,._Bu a:link,._Bu a:visited,a._Bu:link,a._Bu:visited{color:#808080}._kBb{color:#61C}.ellip{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}</style><tr><td id="leftnav" valign="top"><div><h2 class="hd">Search Options</h2><ul class="med" id="tbd"><li><ul class="tbt"><li class="tbos" id="qdr_">Any time</li><li class="tbou" id="qdr_h"><a class="q" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnt&amp;tbs=qdr:h&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQpwUIDw">Past hour</a></li><li class="tbou" id="qdr_d"><a class="q" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnt&amp;tbs=qdr:d&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQpwUIDw">Past 24 hours</a></li><li class="tbou" id="qdr_w"><a class="q" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnt&amp;tbs=qdr:w&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQpwUIDw">Past week</a></li><li class="tbou" id="qdr_m"><a class="q" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnt&amp;tbs=qdr:m&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQpwUIDw">Past month</a></li><li class="tbou" id="qdr_y"><a class="q" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnt&amp;tbs=qdr:y&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQpwUIDw">Past year</a></li></ul></li><li><ul class="tbt"><li class="tbos" id="li_">All results</li><li class="tbou" id="li_1"><a class="q" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;source=lnt&amp;tbs=li:1&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQpwUIDw">Verbatim</a></li></ul></li></ul></div></td><td valign="top"><div id="center_col"><div class="sd" id="resultStats">About 567,000 results</div><div id="res"><div id="topstuff"></div><div id="search"><div id="ires"><ol><div class="g"><h3 class="r"><a href="/url?q=http://loterias.caixa.gov.br/wps/portal/loterias/landing/timemania/&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFggUMAA&amp;usg=AOvVaw1rDRK5wAZamJLnvFbAF9wB"><b>Timemania</b> - Loterias | Caixa</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>loterias.caixa.gov.br/wps/portal/loterias/landing/<b>timemania</b>/</cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0IFTAA" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:B_1Mz2_34w8J:http://loterias.caixa.gov.br/wps/portal/loterias/landing/timemania/%252Btimemania%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQIAgXMAA&amp;usg=AOvVaw2M8qySx6wEC-QtFdLXpKf8">Cached</a></li><li class="_Ykb"><a class="_Zkb" href="/search?ie=UTF-8&amp;q=related:loterias.caixa.gov.br/wps/portal/loterias/landing/timemania/+timemania&amp;tbo=1&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQHwgYMAA">Similar</a></li></ul></div></div></div><span class="st">A <b>Timemania</b> é a loteria para os apaixonados por futebol. Além de o seu palpite <br/> valer uma bolada, você ainda ajuda o seu time do coração. Você escolhe dez <br/> números entre os oitenta disponíveis e um Time do Coração. São sorteados sete <br/> números e um Time do Coração por concurso. Se você tiver de três a sete <br/> acertos, ...</span><br/></div></div><div class="g"><h3 class="r"><a href="/url?q=http://resultadodehoje.com/timemania/&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFggaMAE&amp;usg=AOvVaw3FD7s8Bq1TMmB2LOBMuwJl"><b>Timemania</b> 1151, 03/03/2018 - Resultado da <b>Timemania</b> de Hoje e ...</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>resultadodehoje.com/<b>timemania</b>/</cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0IGzAB" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:ksw3bAfbLmEJ:http://resultadodehoje.com/timemania/%252Btimemania%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQIAgdMAE&amp;usg=AOvVaw1rfZEzNuTCA4NTTskz-xLo">Cached</a></li></ul></div></div></div><span class="st">Resultado da <b>Timemania</b> Ao Vivo: Confira agora o Resultado da <b>Timemania</b> de <br/> Hoje com todas as informações de ganhadores, prêmios, valores, estatísticas e <br/> mais.</span><br/><div class="osl"><a href="/url?q=http://resultadodehoje.com/timemania-1126/&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ0gIIHygAMAE&amp;usg=AOvVaw1eLA87Pdud-qQDspSNFuyI">Timemania 1126</a> - <a href="/url?q=http://resultadodehoje.com/timemania-1129/&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ0gIIICgBMAE&amp;usg=AOvVaw0Y4NufpCk8G5yOtABpRHY2">Timemania 1129</a> - <a href="/url?q=http://resultadodehoje.com/timemania-1128/&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ0gIIISgCMAE&amp;usg=AOvVaw2T5xdizAyvYpFQeIMieu0M">Timemania 1128</a></div></div></div><div class="g"><h3 class="r"><a href="/url?q=https://www.gigasena.com.br/loterias/timemania/&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFggjMAI&amp;usg=AOvVaw0z9vTLcNhmpMoBjvApt9kC">Resultado da <b>Timemania</b> de todos os Sorteios | GIGA-SENA</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>https://www.gigasena.com.br/loterias/<b>timemania</b>/</cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0IJDAC" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:7WTJ4Pe8fP8J:https://www.gigasena.com.br/loterias/timemania/%252Btimemania%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQIAgmMAI&amp;usg=AOvVaw0dt_llXbtRlHDTE1-opbeO">Cached</a></li></ul></div></div></div><span class="st">20 fev. 2018 <b>...</b> <b>Timemania</b> - Confira o resultado da <b>Timemania</b> hoje no GIGA-SENA. O sorteio <br/> da <b>Timemania</b> é realizado na terça-feira, quinta-feira e sábado a partir das 20 <br/> horas.</span><br/><div class="osl"><a href="/url?q=https://www.gigasena.com.br/loterias/timemania/resultados/resultado-timemania-1140.htm&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ0gIIKSgAMAI&amp;usg=AOvVaw2BAIr0x-pzvpDjsr0uYobW">Timemania 1140</a> - <a href="/url?q=https://www.gigasena.com.br/loterias/timemania/resultados/resultado-timemania-1141.htm&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ0gIIKigBMAI&amp;usg=AOvVaw1mXbs7jJyEG3aGNa0_S5j6">Timemania 1141</a> - <a href="/url?q=https://www.gigasena.com.br/loterias/timemania/resultados/resultado-timemania-1112.htm&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ0gIIKygCMAI&amp;usg=AOvVaw3VA0yEEXcZcRqTv52Wf4MU">Resultado da Timemania 1112 ...</a></div></div></div><div class="g"><h3 class="r"><a href="/url?q=https://g1.globo.com/loterias/timemania.ghtml&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFggtMAM&amp;usg=AOvVaw3soymbwm-E07qXgSp3fKA3"><b>Timemania</b> - Resultado da <b>Timemania</b> - G1 Loterias</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>https://g1.globo.com/loterias/<b>timemania</b>.ghtml</cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0ILjAD" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/search?ie=UTF-8&amp;q=related:https://g1.globo.com/loterias/timemania.ghtml+timemania&amp;tbo=1&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQHwgwMAM">Similar</a></li></ul></div></div></div><span class="st">Veja os últimos resultados dos sorteios da <b>Timemania</b>. No G1 você consulta os <br/> concursos das loterias da Caixa Econômica Federal.</span><br/></div></div><div class="g"><h3 class="r"><a href="/url?q=https://noticias.uol.com.br/loterias/timemania/&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFggyMAQ&amp;usg=AOvVaw0NHJQTQcvoFx7UTNJqcjSm"><b>Time Mania</b>: Resultado, números do sorteio e ganhadores - UOL ...</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>https://noticias.uol.com.br/loterias/<b>timemania</b>/</cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0IMzAE" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:eE87ShQNqSEJ:https://noticias.uol.com.br/loterias/timemania/%252Btimemania%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQIAg1MAQ&amp;usg=AOvVaw2yKch_JkpPLfgkxZmrCBuG">Cached</a></li><li class="_Ykb"><a class="_Zkb" href="/search?ie=UTF-8&amp;q=related:https://noticias.uol.com.br/loterias/timemania/+timemania&amp;tbo=1&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQHwg2MAQ">Similar</a></li></ul></div></div></div><span class="st"><b>Time Mania</b>: Confira no UOL Notícias os últimos resultados, números, sorteios, <br/> ganhadores, probabilidade e como jogar. Veja também outras loterias.</span><br/></div></div><div class="g"><h3 class="r"><a href="/url?q=https://www.intersena.com.br/resultados/timemania&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFgg4MAU&amp;usg=AOvVaw0RfYFi6mFe3RqivplSl_e8">Resultado <b>Timemania</b> | Números do Sorteio da <b>Timemania</b> - Intersena</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>https://www.intersena.com.br/resultados/<b>timemania</b></cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0IOTAF" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:8xWCS818-YoJ:https://www.intersena.com.br/resultados/timemania%252Btimemania%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQIAg7MAU&amp;usg=AOvVaw0hftq8P7jk9lJX-Q-FOu9s">Cached</a></li></ul></div></div></div><span class="st">Confira o resultado da <b>Timemania</b> pela internet. Entre agora mesmo no site da <br/> Intersena e veja quais foram os números sorteados. Rápido e Fácil. Boa sorte!</span><br/></div></div><div class="g"><h3 class="r"><a href="/url?q=https://loteriadacaixa.net.br/resultado-do-timemania&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFgg9MAY&amp;usg=AOvVaw0o0mjv1d8S9LezYIEmEMFB">Resultado da <b>Timemania</b> 1151 de 03/03/2018 — Loteria da Caixa</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>https://loteriadacaixa.net.br/resultado-do-<b>timemania</b></cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0IPjAG" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:fQ4ICZym8eUJ:https://loteriadacaixa.net.br/resultado-do-timemania%252Btimemania%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQIAhAMAY&amp;usg=AOvVaw0CFBNyMy9F6I_NnASpcQ35">Cached</a></li></ul></div></div></div><span class="st">Resultado completo da <b>Timemania</b> divulgado imediatamente após o sorteio. <br/> Você também poderá ver estatísticas e resultados de todos os jogos anteriores.</span><br/></div></div><div class="g"><h3 class="r"><a href="/url?q=https://www.sorteonline.com.br/timemania&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFghCMAc&amp;usg=AOvVaw0IZtqkSgIt0nHQO9eq3DyF"><b>Timemania</b>: Resultado, Estatísticas e Como Jogar | Sorte Online</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>https://www.sorteonline.com.br/<b>timemania</b></cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0IQzAH" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:ju_VEEkG6aEJ:https://www.sorteonline.com.br/timemania%252Btimemania%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQIAhFMAc&amp;usg=AOvVaw1rB_8QslcDcoc2oKXOsWfE">Cached</a></li><li class="_Ykb"><a class="_Zkb" href="/search?ie=UTF-8&amp;q=related:https://www.sorteonline.com.br/timemania+timemania&amp;tbo=1&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQHwhGMAc">Similar</a></li></ul></div></div></div><span class="st">Na <b>Timemania</b> você ganha de muitas maneiras, escolha 10 números dentre os <br/> 80 disponíveis e um time do coração dentre as 80 equipes. A loteria é sorteada <br/> as terças, quintas e sábados e ganha quem acertar de 3 a 7 números. Caso <br/> acerte o time do coração (acertando ou não as dezenas), você também ganha!</span><br/></div></div><div class="g"><h3 class="r"><a href="/url?q=https://www.sorteonline.com.br/timemania/jogar&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFghIMAg&amp;usg=AOvVaw07ui_eissbqsO1Awk00Gat"><b>Timemania</b>: Concorra a 1,5 Milhão | Sorte Online</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>https://www.sorteonline.com.br/<b>timemania</b>/jogar</cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0ISTAI" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:apKQ1oVFs1IJ:https://www.sorteonline.com.br/timemania/jogar%252Btimemania%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQIAhLMAg&amp;usg=AOvVaw00j-xADq1thPIOI8_FGKAq">Cached</a></li></ul></div></div></div><span class="st">Na <b>Timemania</b> você ganha de muitas maneiras, escolha 10 números dentre os <br/> 80 disponíveis e um time do coração dentre as 80 equipes. A loteria é sorteada <br/> as terças, quintas e sábados e ganha quem acertar de 3 a 7 números. Caso <br/> acerte o time do coração (acertando ou não as dezenas), você também ganha!</span><br/></div></div><div class="g"><h3 class="r"><a href="/url?q=https://pt.wikipedia.org/wiki/Timemania&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQFghNMAk&amp;usg=AOvVaw3taMPR9YHRgck0ERzXlXmb"><b>Timemania</b> – Wikipédia, a enciclopédia livre</a></h3><div class="s"><div class="kv" style="margin-bottom:2px"><cite>https://pt.wikipedia.org/wiki/<b>Timemania</b></cite><div class="_nBb"><div aria-expanded="false" aria-haspopup="true" data-ved="0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQ7B0ITjAJ" onclick="google.sham(this);" style="display:inline" tabindex="0"><span class="_O0"></span></div><div class="am-dropdown-menu" role="menu" style="display:none" tabindex="-1"><ul><li class="_Ykb"><a class="_Zkb" href="/url?q=http://webcache.googleusercontent.com/search%3Fq%3Dcache:Usf0S-BZDvMJ:https://pt.wikipedia.org/wiki/Timemania%252Btimemania%26hl%3Den%26ct%3Dclnk&amp;sa=U&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQIAhQMAk&amp;usg=AOvVaw0gXvboOAbI1x8ohxcOho7G">Cached</a></li><li class="_Ykb"><a class="_Zkb" href="/search?ie=UTF-8&amp;q=related:https://pt.wikipedia.org/wiki/Timemania+timemania&amp;tbo=1&amp;sa=X&amp;ved=0ahUKEwjepJrZ8tPZAhUSDKwKHThJDLAQHwhRMAk">Similar</a></li></ul></div></div></div><span class="st"><b>Timemania</b> é um jogo de loteria organizado pelo Governo Federal, através da <br/> Caixa Econômica Federal. Índice. [esconder]. 1 Objetivo; 2 Funcionamento; 3 <br/> Probabilidade de acerto; 4 Distribuição da arrecadação; 5 Clubes participantes. <br/> 5.1 Lista de Clubes participantes. 6 Ver também; 7 Ligações externas; 8 <br/> Referências ...</span><br/></div></div></ol></div></div></div></div><div id="foot"><table align="center" border="0" cellpadding="0" cellspacing="0" id="nav"><tr valign="top"><td align="left" class="b"><span class="csb" style="background-position:-24px 0;width:28px"></span><b></b></td><td><span class="csb" style="background-position:-53px 0;width:20px"></span><b>1</b></td><td><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=10&amp;sa=N"><span class="csb" style="background-position:-74px 0;width:20px"></span>2</a></td><td><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=20&amp;sa=N"><span class="csb" style="background-position:-74px 0;width:20px"></span>3</a></td><td><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=30&amp;sa=N"><span class="csb" style="background-position:-74px 0;width:20px"></span>4</a></td><td><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=40&amp;sa=N"><span class="csb" style="background-position:-74px 0;width:20px"></span>5</a></td><td><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=50&amp;sa=N"><span class="csb" style="background-position:-74px 0;width:20px"></span>6</a></td><td><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=60&amp;sa=N"><span class="csb" style="background-position:-74px 0;width:20px"></span>7</a></td><td><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=70&amp;sa=N"><span class="csb" style="background-position:-74px 0;width:20px"></span>8</a></td><td><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=80&amp;sa=N"><span class="csb" style="background-position:-74px 0;width:20px"></span>9</a></td><td><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=90&amp;sa=N"><span class="csb" style="background-position:-74px 0;width:20px"></span>10</a></td><td class="b" style="text-align:left"><a class="fl" href="/search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns&amp;ei=NYucWp62FJKYsAW4krGACw&amp;start=10&amp;sa=N" style="text-align:left"><span class="csb" style="background-position:-96px 0;width:71px"></span><span style="display:block;margin-left:53px">Next</span></a></td></tr></table><p class="_cD" id="bfl" style="margin:19px 0 0;text-align:center"><a href="/advanced_search?q=timemania&amp;ie=UTF-8&amp;prmd=ivns">Advanced search</a><a href="/support/websearch/bin/answer.py?answer=134479&amp;hl=en">Search Help</a> <a href="/tools/feedback/survey/html?productId=196&amp;query=timemania&amp;hl=en">Send feedback</a></p><div class="_cD" id="fll" style="margin:19px auto 19px auto;text-align:center"><a href="/">Google Home</a> <a href="/intl/en/ads">Advertising Programs</a> <a href="/services">Business Solutions</a> <a href="/intl/en/policies/privacy/">Privacy</a> <a href="/intl/en/policies/terms/">Terms</a> <a href="/intl/en/about.html">About Google</a></div></div></td><td id="rhs_block" valign="top"></td></tr></tbody></table><script nonce="RMsOTWgFbj7tftoaaaLSNA==" type="text/javascript">(function(){var eventid='NYucWp62FJKYsAW4krGACw';google.kEI = eventid;})();</script><script nonce="RMsOTWgFbj7tftoaaaLSNA==" src="/xjs/_/js/k=xjs.hp.en_US.ai0w-88-1kM.O/m=sb_he,d/rt=j/d=1/t=zcms/rs=ACT90oF2AW2m8CiOg6NdMdLEoNnXd1Nlag"></script><script nonce="RMsOTWgFbj7tftoaaaLSNA==" type="text/javascript">google.ac&&google.ac.c({"agen":true,"cgen":true,"client":"heirloom-serp","dh":true,"dhqt":true,"ds":"","ffql":"en","fl":true,"host":"google.com.br","isbh":28,"jsonp":true,"msgs":{"cibl":"Clear Search","dym":"Did you mean:","lcky":"I\u0026#39;m Feeling Lucky","lml":"Learn more","oskt":"Input tools","psrc":"This search was removed from your \u003Ca href=\"/history\"\u003EWeb History\u003C/a\u003E","psrl":"Remove","sbit":"Search by image","srch":"Google Search"},"nds":true,"ovr":{},"pq":"timemania","refpd":true,"rfs":[],"sbpl":24,"sbpr":24,"scd":10,"sce":5,"stok":"PeUMEm86-Do2f-dRTWp72YIHdTE"})</script><script nonce="RMsOTWgFbj7tftoaaaLSNA==">(function(){window.google.cdo={height:0,width:0};(function(){var a=window.innerWidth,b=window.innerHeight;if(!a||!b){var c=window.document,d="CSS1Compat"==c.compatMode?c.documentElement:c.body;a=d.clientWidth;b=d.clientHeight}a&&b&&(a!=google.cdo.width||b!=google.cdo.height)&&google.log("","","/client_204?&atyp=i&biw="+a+"&bih="+b+"&ei="+google.kEI);}).call(this);})();</script></body></html> div_balls: []
now I need to see what's wrong with your find_all
Reply
#5
The reason it's not finding the class is that kno-fb-ctx _i2g doesn't exist!
Reply
#6
(Mar-02-2018, 01:25 PM)amandacstr Wrote: I heard I can use PhantomJS but could you guys indicate me something else to?
Can still use PhantomJS,but both Chrome and Firefox has now drivers that work headless for Selenium.
So the fact is that BeautifulSoup or lxml can not get all info from a Google search,beacuse of the dynamically generated JavaScript.
amandacstr Wrote:In the following code I'm trying to get the number 1151 from the span tag inside the span tag <span class="kno-fb-ctx _i2g"
Why do you try do this for a Google search(which is a diffcult to parse) is there not a specific site that has that info?

Here something i have written before that get content using PhantomJS still work.
from selenium import webdriver
from bs4 import BeautifulSoup

class GoogleSearch:
    def __init__(self, search, page=0):
        self.search = search
        self.page = page
        self.url = f'https://www.google.com/search?q={self.search}\
                    &ei=m3w9WuyXNJHMwALelovwAQ&start={str(self.page)+"0"}&sa=N&biw=848&bih=972'
        self.result()

    def result(self):
        browser = webdriver.PhantomJS()
        browser.get(self.url)
        soup = BeautifulSoup(browser.page_source, 'lxml')
        name_link = soup.find_all('h3', class_='r')
        link = soup.find_all('cite')
        for n_link, l in zip(name_link,link):
            print(f'{n_link.text}\n{l.text}')
            print('---------')

if __name__ == '__main__':
    GoogleSearch('python forum')
    #GoogleSearch('python forum', page=1)
Output:
Forums | Python.org https://www.python.org/community/forums/ --------- Our Community | Python.org https://www.python.org/community/ --------- Python Forum https://python-forum.io/ --------- What are the best Python forums to hang out in? : Python - Reddit https://www.reddit.com/.../Python/.../what_are_the_best_python_forums_to_ hang_out_in/ --------- Python Forum | Dream.In.Code - DreamInCode.net www.dreamincode.net/forums/forum/29-python/ --------- Python Programming - Dev Shed Forums forums.devshed.com/python-programming-11/ --------- Python For Beginners Forum | Codecademy https://www.codecademy.com/en/forums/python-for-beginners --------- What are some active Python forums for beginners? - Quora https://www.quora.com/What-are-some-active-Python-forums-for-beginners --------- Python - Flashback Forum https://www.flashback.org/f307 --------- Python - CodingForums https://www.codingforums.com/python/ ---------
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Question Python Obstacles | Jeet-Kune-Do | BS4 (Tags > MariaDB) [URL/Local HTML] BrandonKastning 0 1,400 Feb-08-2022, 08:55 PM
Last Post: BrandonKastning
  HTML multi select HTML listbox with Flask/Python rfeyer 0 4,529 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Any way to remove HTML tags from scraped data? (I want text only) SeBz2020uk 1 3,411 Nov-02-2020, 08:12 PM
Last Post: Larz60+
  Open and read a tab delimited file from html using python cgi luffy 2 2,633 Aug-24-2020, 06:25 AM
Last Post: luffy
  Easy HTML Parser: Validating trs by attributes several tags deep? runswithascript 7 3,499 Aug-14-2020, 10:58 PM
Last Post: runswithascript
  Jinja2 HTML <a> tags not rendering properly ChaitanyaPy 4 3,182 Jun-28-2020, 06:12 PM
Last Post: ChaitanyaPy
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 2,328 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning
  How do I get rid of the HTML tags in my output? glittergirl 1 3,691 Aug-05-2019, 08:30 PM
Last Post: snippsat
  Beutifulsoup: how to pick text that's not in HTML tags? pitonas 4 4,641 Oct-08-2018, 01:43 PM
Last Post: pitonas
  read text file using python and display its output to html using django amit 0 18,262 Jul-23-2017, 06:14 AM
Last Post: amit

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020