|
@@ -49,6 +49,8 @@ def deep_explorate(state_id, region_id, resource_type, amount, alt):
|
|
headers=HEADERS,
|
|
headers=HEADERS,
|
|
params=params
|
|
params=params
|
|
)
|
|
)
|
|
|
|
+ if response.status_code != 200:
|
|
|
|
+ LOGGER.warning('Error %s in response', response.status_code)
|
|
soup = BeautifulSoup(response.text, 'html.parser')
|
|
soup = BeautifulSoup(response.text, 'html.parser')
|
|
state_div = soup.find_all('div', {'class': 'index_case_50'})[1]
|
|
state_div = soup.find_all('div', {'class': 'index_case_50'})[1]
|
|
action = state_div.findChild()['action']
|
|
action = state_div.findChild()['action']
|
|
@@ -81,7 +83,7 @@ def deep_explorate(state_id, region_id, resource_type, amount, alt):
|
|
)
|
|
)
|
|
soup = BeautifulSoup(response.text, 'html.parser')
|
|
soup = BeautifulSoup(response.text, 'html.parser')
|
|
active_laws = soup.find('div', {'id': 'parliament_active_laws'})
|
|
active_laws = soup.find('div', {'id': 'parliament_active_laws'})
|
|
- for exploration_law in active_laws.findAll(text='Deep exploration,'):
|
|
|
|
|
|
+ for exploration_law in active_laws.findAll(text=re.compile('Deep exploration,')):
|
|
action = exploration_law.parent.parent['action']
|
|
action = exploration_law.parent.parent['action']
|
|
action = action.replace('law', 'votelaw')
|
|
action = action.replace('law', 'votelaw')
|
|
result = requests.post(
|
|
result = requests.post(
|