This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Fungsi menghitung kecepatan | |
| def kecepatan(jarak, waktu): | |
| hasil = float(jarak) / float(waktu) | |
| return hasil | |
| # Fungsi menghitung jarak | |
| def jarak(kecepatan, waktu): | |
| hasil = float(kecepatan) * float(waktu) | |
| return hasil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import rumus | |
| print("Pilih Rumus Yang Ingin Dihitung: Ketik 'quit' untuk keluar dari program.") | |
| print("1. Kecepatan") | |
| print("2. Jarak") | |
| print("3. Waktu") | |
| def app(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://example.com/api/book?key=ImhDM1Y0WGZUU2JlNmFSZVYuaGFuZHJ5bGFnaS5pMnNHMTFseWFUMEUxcnNhIg.K2JCKMF1gbBMrkr-viW8TY7dv0U | |
| http://example.com/api/book?page=2&<key> (untuk mendapatkan list buku perhalaman) | |
| http://example.com/api/book?limit=30&<key> (untuk mendapatkan list buku dengan jumlah limit tertentu) | |
| http://example.com/api/book?page=2&limit=30&<key> (untuk mendapatkan list buku keduanya) | |
| [ | |
| [ | |
| { | |
| "code": 200, | |
| "msg": "success", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "Products": [ | |
| { | |
| "product_image": "https://s2.bukalapak.com/img/2405945661/s-194-194/Metode_Rubaiyat__Cara_Mudah_Belajar_Al_Qur_an__4_jam_bisa_ba.jpg", | |
| "product_link": "https://www.bukalapak.com/p/hobi-koleksi/buku/agama-kepercayaan/1476rr-jual-metode-rubaiyat-cara-mudah-belajar-al-qur-an-4-jam-bisa-baca-al-quran", | |
| "product_name": "Metode Rubaiyat, Cara Mudah Belajar Al-Qur'an, 4 jam bisa baca Al-Quran", | |
| "product_price": "Rp625.000", | |
| "product_review": 523 | |
| }, | |
| { | |
| "product_image": "https://s2.bukalapak.com/img/7735547831/s-194-194/Celana_Chino___Celana_kerja_pria.jpg", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from bs4 import BeautifulSoup | |
| import requests | |
| def scrape(): | |
| l = [] | |
| for page in range(0, 3): | |
| page = page + 1 | |
| base_url = 'https://www.bukalapak.com/promo/serba-serbu-produk-terlaris-bukalapak?\ | |
| from=old-popular-section-3&page=' + str(page) |