使用时的正确有效载荷请求.pos

2024-04-29 17:00:48 发布

您现在位置:Python中文网/ 问答频道 /正文

显然是新的刮,但试图提交以下表格: https://apps.fcc.gov/oetcf/eas/reports/GenericSearch.cfm?calledFromFrame=N

有这个脚本到目前为止,但不确定我是否完全理解有效载荷去与一个职位。是否需要所有输入?你知道吗

import requests
from bs4 import BeautifulSoup
import time

payload ={'grantee_code' : '', 
          'product_code' : '', 
          'product_exact_match' : '', 
          'applicant_name' : '',
          'grant_date_from' : '01/01/2017', 
          'grant_date_to' : '02/01/2017', 
          'comments' : '', 
          'application_purpose' : 'O', 
          'application_purpose_description' : '',
          'sdr_filings_only' : '', 
          'eas_apps_only' : '', 
          'tcb_apps_only' : '', 
          'composite_apps_only' : '',
          'grant_code_1' : '',
          'grant_code_2' : '', 
          'grant_code_3' : '', 
          'test_firm' : '', 
          'application_status' : '', 
          'application_status_description' : '',
          'equipment_class' : '', 
          'equipment_class_description' : '',
          'lower_frequency' : '2402', 
          'upper_frequency' : '2480', 
          'freq_exact_match' : '', 
          'bandwidth_from' : '', 
          'emission_designator' : '', 
          'tolerance_from' : '', 
          'tolerance_to' : '', 
          'tolerance_exact_match' : '', 
          'power_output_from' : '',
          'power_output_to' : '', 
          'power_exact_match' : '', 
          'rule_part_1' : '', 
          'rule_part_2' : '', 
          'rule_part_3' : '', 
          'rule_part_exact_match' : '', 
          'product_description' : '', 
          'modular_type' : '', 
          'modular_type_description' : '', 
          'tcb_code' : '', 
          'tcb_code_description' : '',
          'tcb_scope' : '',
          'tcb_scope_description' : '',
          'outputformat' : 'HTML',
          'show_records' : '499',
          'fetchfrom' : '0',
          'calledFromFrame' : 'N'
          }


url = 'https://apps.fcc.gov/oetcf/eas/reports/GenericSearchResult.cfm?RequestTimeout=500'
r = requests.post(url, payload)
soup = BeautifulSoup(r.text)

print(soup)

Tags: appsfromimportonlyapplicationmatchcodedescription