Skip to content

Commit 6804a2b

Browse files
author
John Seekins
committedJun 23, 2022
handle bad SSL config in FL and filter retired people better in FL
Signed-off-by: John Seekins <[email protected]>
1 parent ebb3f53 commit 6804a2b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed
 

‎openssl.cnf

+1
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ system_default = system_default_sect
88

99
[system_default_sect]
1010
Options = UnsafeLegacyRenegotiation
11+
CipherString = DEFAULT:@SECLEVEL=1

‎scrapers_next/fl/people.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def process_item(self, item):
3939
district = item.xpath("string(../../td[1])")
4040
party = item.xpath("string(../../td[2])")
4141
leg_url = item.get("href")
42+
if not district or not party or not leg_url:
43+
self.skip()
4244

4345
return SenDetail(
4446
PartialPerson(name=name, party=party, district=district, url=leg_url)
@@ -50,15 +52,15 @@ class SenDetail(HtmlPage):
5052
input_type = PartialPerson
5153

5254
def get_source_from_input(self):
53-
return URL(self.input.url, timeout=10)
55+
return URL(self.input.url, timeout=30)
5456

5557
def process_page(self):
5658
email = (
5759
self.root.xpath('//a[contains(@href, "mailto:")]')[0]
5860
.get("href")
5961
.split(":")[-1]
6062
)
61-
63+
print(self.input)
6264
p = ScrapePerson(
6365
state="fl",
6466
chamber="upper",
@@ -162,12 +164,15 @@ class Representatives(HtmlListPage):
162164

163165
def process_item(self, item):
164166
name = item.xpath("./a/div[@class='team-txt']/h5/text()")[0].strip()
167+
if name == "Pending, Election":
168+
self.skip()
165169
party = item.xpath("./a/div[@class='team-txt']/p[1]/text()")[0].split()[0]
166170
district = item.xpath("./a/div[@class='team-txt']/p[1]/span/text()")[0].split()[
167171
-1
168172
]
169173
image = self.IMAGE_BASE + item.xpath(".//img")[0].attrib["data-src"]
170174
link = str(item.xpath("./a/@href")[0])
175+
print(name, party, district)
171176

172177
return RepContact(
173178
PartialPerson(

0 commit comments

Comments
 (0)
Please sign in to comment.