网页抓取以获得所需的输出格式

时间:2016-11-14 09:28:01

标签: python python-3.x web-scraping

我正在尝试废弃azure网站以获取实例价格,但仍然坚持使用所需的输出格式,任何人都可以帮助我获取输出..

这是示例源页面

<section class="section section-size3"> <div class="row column"> <h2>Virtual machines categories</h2> </div> <div class="row row-size2 column"> <a class="toggler toggler-pricing" data-event="pricingdetails-clicked-accordion" href="#"> <h3 class="heading">General Purpose</h3> <p class="sd-truncateText">Balanced CPU to memory ratio. Ideal for testing and development, small to medium databases and low to medium traffic web servers.</p> </a> <div class="toggled"> <div class="row row-size3 column"> <h3>A0-4 – Basic <a class="arrowLink text-heading5" href="/en-in/pricing/details/virtual-machines/series/#a-series">More information</a></h3> <p>A Basic is an economical option for development workloads, test servers, build servers, code repositories, low-traffic websites and web applications, micro services, early product experiments and small databases.</p> <table class="table-width-even"> <thead> <tr> <th>Instance</th> <th>Cores</th> <th>RAM</th> <th>Disk sizes</th> <th>Price</th> </tr> </thead> <tbody> <tr> <td> A0 </td> <td>1</td> <td>0.75 GB</td> <td><strong>20</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.018,"us-west":0.018,"us-north-central":0.018,"us-south-central":0.018,"europe-north":0.018,"europe-west":0.018,"asia-pacific-southeast":0.018,"asia-pacific-east":0.018,"japan-east":0.022,"japan-west":0.019,"brazil-south":0.022,"us-east-2":0.018,"us-central":0.018,"usgov-virginia":0.017,"usgov-iowa":0.017,"australia-east":0.024,"australia-southeast":0.024,"central-india":0.018,"south-india":0.016,"canada-east":0.02,"canada-central":0.022,"germany-central":0.021,"germany-northeast":0.021,"united-kingdom-west":0.02,"united-kingdom-south":0.02,"us-west-2":0.018,"us-west-central":0.018}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.018</span> </td> </tr> <tr> <td> A1 </td> <td>1</td> <td>1.75 GB</td> <td><strong>40</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.035,"us-west":0.034,"us-north-central":0.038,"us-south-central":0.035,"europe-north":0.028,"europe-west":0.027,"asia-pacific-southeast":0.037,"asia-pacific-east":0.046,"japan-east":0.04,"japan-west":0.044,"brazil-south":0.054,"us-east-2":0.024,"us-central":0.038,"usgov-virginia":0.04,"usgov-iowa":0.04,"australia-east":0.04,"australia-southeast":0.046,"central-india":0.038,"south-india":0.042,"canada-east":0.038,"canada-central":0.042,"germany-central":0.0322,"germany-northeast":0.0322,"united-kingdom-west":0.056,"united-kingdom-south":0.056,"us-west-2":0.024,"us-west-central":0.035}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.044</span> </td> </tr> <tr> <td> A2 </td> <td>2</td> <td>3.50 GB</td> <td><strong>60</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.079,"us-west":0.081,"us-north-central":0.085,"us-south-central":0.079,"europe-north":0.075,"europe-west":0.078,"asia-pacific-southeast":0.095,"asia-pacific-east":0.104,"japan-east":0.109,"japan-west":0.099,"brazil-south":0.112,"us-east-2":0.068,"us-central":0.085,"usgov-virginia":0.08,"usgov-iowa":0.08,"australia-east":0.098,"australia-southeast":0.104,"central-india":0.096,"south-india":0.094,"canada-east":0.087,"canada-central":0.095,"germany-central":0.0863,"germany-northeast":0.0863,"united-kingdom-west":0.112,"united-kingdom-south":0.112,"us-west-2":0.068,"us-west-central":0.079}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.088</span> </td> </tr> <tr> <td> A3 </td> <td>4</td> <td>7.00 GB</td> <td><strong>120</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.176,"us-west":0.188,"us-north-central":0.188,"us-south-central":0.176,"europe-north":0.188,"europe-west":0.204,"asia-pacific-southeast":0.232,"asia-pacific-east":0.232,"japan-east":0.276,"japan-west":0.2196,"brazil-south":0.232,"us-east-2":0.176,"us-central":0.188,"usgov-virginia":0.16,"usgov-iowa":0.16,"australia-east":0.232,"australia-southeast":0.232,"central-india":0.232,"south-india":0.209,"canada-east":0.194,"canada-central":0.211,"germany-central":0.216,"germany-northeast":0.216,"united-kingdom-west":0.224,"united-kingdom-south":0.224,"us-west-2":0.176,"us-west-central":0.176}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.176</span> </td> </tr> <tr> <td> A4 </td> <td>8</td> <td>14.00 GB</td> <td><strong>240</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.352,"us-west":0.376,"us-north-central":0.376,"us-south-central":0.352,"europe-north":0.376,"europe-west":0.408,"asia-pacific-southeast":0.464,"asia-pacific-east":0.464,"japan-east":0.552,"japan-west":0.4392,"brazil-south":0.464,"us-east-2":0.352,"us-central":0.376,"usgov-virginia":0.32,"usgov-iowa":0.32,"australia-east":0.464,"australia-southeast":0.464,"central-india":0.464,"south-india":0.418,"canada-east":0.387,"canada-central":0.422,"germany-central":0.432,"germany-northeast":0.432,"united-kingdom-west":0.449,"united-kingdom-south":0.449,"us-west-2":0.352,"us-west-central":0.352}}'

</div> <div class="row row-size3 column"> <h3>Av2 Standard <a class="arrowLink text-heading5" href="/en-in/pricing/details/virtual-machines/series/#a-series">More information</a></h3> <p>Av2 Standard is the latest generation of A series VMs with similar CPU performance and faster disk. These VMs are suitable for development workloads, build servers, code repositories, low-traffic websites and web applications, micro services, early product experiments and small databases. Like the prior A Standard generation, Av2 VMs will include load balancing and auto-scaling at no additional charge.</p> <table class="table-width-even"> <thead> <tr> <th>Instance</th> <th>Cores</th> <th>RAM</th> <th>Disk sizes</th> <th>Price</th> </tr> </thead> <tbody> <tr> <td> A1 v2 </td> <td>1</td> <td>2.00 GB</td> <td><strong>10</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.043,"us-west":0.043,"us-north-central":0.043,"us-south-central":0.043,"europe-north":0.041,"europe-west":0.041,"asia-pacific-southeast":0.045,"asia-pacific-east":0.05,"japan-east":0.054,"japan-west":0.054,"brazil-south":0.061,"us-east-2":0.043,"us-central":0.043,"usgov-virginia":0.048,"usgov-iowa":0.048,"australia-east":0.5,"australia-southeast":0.05,"central-india":0.047,"south-india":0.047,"canada-east":0.043,"canada-central":0.047,"germany-central":0.055,"germany-northeast":0.055,"united-kingdom-west":0.05,"united-kingdom-south":0.05,"us-west-2":0.036,"us-west-central":0.04}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.043</span> </td> </tr> <tr> <td> A2 v2 </td> <td>2</td> <td>4.00 GB</td> <td><strong>20</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.091,"us-west":0.091,"us-north-central":0.091,"us-south-central":0.091,"europe-north":0.087,"europe-west":0.087,"asia-pacific-southeast":0.095,"asia-pacific-east":0.106,"japan-east":0.113,"japan-west":0.113,"brazil-south":0.129,"us-east-2":0.091,"us-central":0.091,"usgov-virginia":0.097,"usgov-iowa":0.097,"australia-east":0.106,"australia-southeast":0.106,"central-india":0.098,"south-india":0.098,"canada-east":0.091,"canada-central":0.098,"germany-central":0.109,"germany-northeast":0.109,"united-kingdom-west":0.106,"united-kingdom-south":0.106,"us-west-2":0.076,"us-west-central":0.083}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.091</span> </td> </tr> <tr> <td> A4 v2 </td> <td>4</td> <td>8.00 GB</td> <td><strong>40</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.191,"us-west":0.191,"us-north-central":0.191,"us-south-central":0.191,"europe-north":0.183,"europe-west":0.183,"asia-pacific-southeast":0.198,"asia-pacific-east":0.222,"japan-east":0.238,"japan-west":0.238,"brazil-south":0.27,"us-east-2":0.191,"us-central":0.191,"usgov-virginia":0.194,"usgov-iowa":0.194,"australia-east":0.222,"australia-southeast":0.222,"central-india":0.206,"south-india":0.206,"canada-east":0.191,"canada-central":0.206,"germany-central":0.218,"germany-northeast":0.218,"united-kingdom-west":0.222,"united-kingdom-south":0.222,"us-west-2":0.159,"us-west-central":0.175}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.191</span> </td> </tr> <tr> <td> A8 v2 </td> <td>8</td> <td>16.00 GB</td> <td><strong>80</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.6,"us-west":0.4,"us-north-central":0.4,"us-south-central":0.4,"europe-north":0.383,"europe-west":0.383,"asia-pacific-southeast":0.417,"asia-pacific-east":0.467,"japan-east":0.5,"japan-west":0.5,"brazil-south":0.567,"us-east-2":0.4,"us-central":0.4,"usgov-virginia":0.387,"usgov-iowa":0.387,"australia-east":0.467,"australia-southeast":0.467,"central-india":0.433,"south-india":0.433,"canada-east":0.4,"canada-central":0.433,"germany-central":0.437,"germany-northeast":0.437,"united-kingdom-west":0.467,"united-kingdom-south":0.467,"us-west-2":0.333,"us-west-central":0.367}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.4</span> </td> </tr> <tr> <td> A2m v2 </td> <td>2</td> <td>16.00 GB</td> <td><strong>20</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.119,"us-west":0.149,"us-north-central":0.129,"us-south-central":0.124,"europe-north":0.139,"europe-west":0.124,"asia-pacific-southeast":0.134,"asia-pacific-east":0.178,"japan-east":0.153,"japan-west":0.178,"brazil-south":0.208,"us-east-2":0.119,"us-central":0.129,"usgov-virginia":0.176,"usgov-iowa":0.176,"australia-east":0.149,"australia-southeast":0.178,"central-india":0.158,"south-india":0.144,"canada-east":0.129,"canada-central":0.168,"germany-central":0.251,"germany-northeast":0.251,"united-kingdom-west":0.158,"united-kingdom-south":0.178,"us-west-2":0.099,"us-west-central":0.119}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.149</span> </td> </tr> <tr> <td> A4m v2 </td> <td>4</td> <td>32.00 GB</td> <td><strong>40</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.238,"us-west":0.297,"us-north-central":0.27,"us-south-central":0.248,"europe-north":0.291,"europe-west":0.26,"asia-pacific-southeast":0.281,"asia-pacific-east":0.374,"japan-east":0.322,"japan-west":0.374,"brazil-south":0.437,"us-east-2":0.249,"us-central":0.27,"usgov-virginia":0.353,"usgov-iowa":0.353,"australia-east":0.312,"australia-southeast":0.374,"central-india":0.333,"south-india":0.301,"canada-east":0.27,"canada-central":0.353,"germany-central":0.502,"germany-northeast":0.502,"united-kingdom-west":0.333,"united-kingdom-south":0.374,"us-west-2":0.208,"us-west-central":0.249}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.297</span> </td> </tr> <tr> <td> A8m v2 </td> <td>8</td> <td>64.00 GB</td> <td><strong>80</strong> GB</td> <td> <span class="price-data " data-amount='{"regional":{"us-east":0.475,"us-west":0.594,"us-north-central":0.568,"us-south-central":0.495,"europe-north":0.611,"europe-west":0.546,"asia-pacific-southeast":0.589,"asia-pacific-east":0.786,"japan-east":0.677,"japan-west":0.786,"brazil-south":0.917,"us-east-2":0.524,"us-central":0.568,"usgov-virginia":0.704,"usgov-iowa":0.704,"australia-east":0.655,"australia-southeast":0.786,"central-india":0.699,"south-india":0.633,"canada-east":0.568,"canada-central":0.742,"germany-central":1.004,"germany-northeast":1.004,"united-kingdom-west":0.699,"united-kingdom-south":0.786,"us-west-2":0.437,"us-west-central":0.524}}' data-hour-format="{0}/hr" data-month-format="{0}/mo" data-region-unavailable="N/A">$0.594</span> </td> </tr> </tbody> </table>

我怎样才能低于输出......

通用A0 us-east 0.018通用A0 us-west 0.018 ......... ........................ .......等............................通用A1 us-east 0.018 ...... .. ...............................等等............... ...... Av2标准A0 us-west 0.19 ..................... ................ ................................................ ...... .......等等...................................

0 个答案:

没有答案