python - Dynamically generated webpage scraping -
i'm trying build parser can download data web page. problem page "dynamically generated". there code in curly brackets generates html code probably. seems django code.
here pattern:
<script charset="utf-8" type="text/javascript">var browsedefaultcolumn = 4; var browse5columnlength= '15,24'; var browse4columnlength = '20,28'; var browse3columnlength = '25,42';var pricefiltersliderenabled = true;var browselowpagelength = 24;var browsehighpagelength = 100;</script> <script id="products-template" type="text/template"> {{#products}} <li class="{{rowcssclass}}" style="{{rowstyle}}" li-productid="{{itemcode}}"> <div class="s-productthumbbox"> <div class="productimage s-productthumbimage col-xs-6 col-sm-12 col-md-12"> <a href="{{prdurl}}" class="s-product-sache">{{#imgsashvisible}} <img src="{{imgsashurl}}" class="rtsashimg img-responsive"> {{/imgsashvisible}} </a> <a href="{{prdurl}}" class="productimagelist"> <div> <img class="rtimg img-responsive" src='{{mainimage}}' alt='{{brand}} {{displayname}}' /> </div> {{#enablealtimages}} <div class="alternateimagecontainerdiv"> <img class="rtimg productimagelistalternateimage img-responsive" src='{{altimage}}' alt='{{brand}} {{displayname}}' /> </div> {{/enablealtimages}} </a> <div class="quickbuyandwishlistcontainerdiv hidden-xs {{quickbuyandwishlistcss}}"> {{#isquickbuyenabled}}
i'm looking way how whole code containing generated code can parse example using beautiful soup. or other efficient way data.
the html have template, , needs parsed template engine populate content, after should able final html , parse that.
not template html server server, must offline file?
Comments
Post a Comment