Adding Officers to Illinois

Adding an officers section to the Illinois Secretary of State API. The idea behind my code here is solid but I didn’t achieve it during this video.

The main problem was matching the label when pulling the text from some kind of br separated HTML. In the end I did something like this:

  // This is a multi line label so we hack together our own to make the switch case
  if (label.trim().includes('Name') && label.trim().includes('Address')) {
   label = 'Name Address';
  }

It’s a hack that forced the case statement to match what I wanted.

If you need a Secretary of State API key, get one for free here – https://cobaltintelligence.com/secretary-of-state

Illinois Secretary of State search – https://apps.ilsos.gov/corporatellc/CorporateLlcController

Transcript:

Hello, there I am Jordan Hanson. I’m from cobalt intelligence. I’m here talking about a little bit about the secretary. Can’t talk, talking about the secretary of state API. And today we’re going to go to Illinois renter. The ad officer information is what we’re going to try to do. I’ve done a little bit of preliminary investigation.

Here’s uh, the Illinois secretary of state. And over here, you can get a, you can see the managers are here and I think those are the officers right now. We’re just getting the. Um, the agent information. So we’re going over here. I also like to get documents if I can, but it doesn’t look like this one has documents available.

I think you only have to purchase them. Um, I’m not sure I haven’t seen it anywhere else. So what we’re going to do over here first, we’re going to check out in the branch Illinois officers, and then I think it should be pretty simple. We’re going to come over here and we’re just going to go over here and get the officers.

How are we doing this now? Sorry. Now we’re getting a list of all we’re using puppet here. We’re going to list of all rows. I think I’m at the know specifically that they’re officer’s

how’d that work? Oh, it’s dot row. So it’s this. Oh, this is a row.

How am I going to know if they’re,

I guess the name, how come that is?

I was named an address. Okay. Okay. We’re going to do that a little differently than I wonder if we can delineate between this as being managed or not. No, not well done. This might be a pain then.

I’m kind of curious what this looks like. It’s gonna be like name, address, like if we did a case.

well, let’s try that if we went like this, so there, we got dollar saying,

bro. Yeah. Like that, we’ll say,

why does it go like this? The value. It’s going to div into type one. Okay. So type one, a bunch of them. Each one has, oh, wait, I want to get the text. Maybe I’ll just give me everything or that, put it in the re let’s see that all look how small that is. If I can’t see anything, they’re a little gross. Yeah.

Put them all in one thing. Okay. So we’re going to with this, let me make this bigger. This is like this and this, this assume. Cause there’s going to be a Ray, right? Let’s go like this. Or Dick 10. Was that, or does that do not have the work? Okay. Whatever. We’ll push it up and track. I think let’s go look at how these other ones look.

It’s like this right here. The div is just name. But if I go look over this one and the manager section, the div is going to be this.

It’s going to get just the text content, which we name and address where there’ll be a space between them. I’m going to log them out. What’s this it’s gonna be a bunch, but we’re gonna log onto that log labeled it.

And then we’re going to go with this. Get commit Illinois search it’s Amela NOI. And we’re going to say, sorry, officer put short in the house. There we go, that’ll push up to that and then we’ll try it. And this is this what business? This right there. It’s going to take a second for it to deploy. I get my STK over here so I can test it out.

I’m testing in Illinois right now, the dev environment. Perfect. I don’t think it’s gonna be ready yet. And I’m going to do lot. Yeah. Okay. So what am I doing? Uh, I don’t know,

probably gonna be too soon for this. Yeah, we don’t want to not that’s too soon. It’s out there.

Let’s do it again. Let’s do it again. I can write good officers, officers, officers. That’s what we’re looking for. Illinois. Secretary of state officers and the Norway officers managers, what are we going to call it? And it was updated six days ago up there yet actions over here. So go on. There is not yet ready,

but it’s gonna be something like name, address. And so if the equals name, address, and here we set the parse at bed BR

I think we can do that. We’ll get the NHD melt that one.

Okay. Now it should be done. I set it up. That’s going to be a new version of that. 43 here where it could be, I guess. I don’t think so though.

Let’s try another 1 45. That’s it. Here’s our . Here’s all of our labels name, address right there. I see, man. I was right. Okay, cool. Put that back up here. And then we’re going to come out to this. Around make a section for that. Uh, this right here, this is they manager the name address, and we go like this. No, we’re going to say

we need the value, but we don’t this time when you actually put HTML content.

So we’ve got this

valuation equals await the page. No, Eero I like this. This is what I need. This thing.

I get that and I’m going to get into type, but this is going to be an HTML instead like that. What’s going to give me this thing. Right.

And then the first one, we’re going to say split

a, that would go, and it’s going to be equals valuation. Timo does split. BR,

and then we’re going to say constant name equals. Can we say parse is I have a Park’s name here?

Uh, I know I have it somewhere.

Come on, hellebores. I have on my function for parsing a name. Let’s see here. Price address, comma price, Ajit BI new line

results. What does this do? Hold on. This’ll be okay.

Okay. Well, first of all, we can do this. I think we can go with this parse address, be our new line, and it’s going to be a, this split on BR.

One. What if there’s oh, avenue. Oh, it has the sweet in there. Okay. That one

really it’s like this. Yeah. We’ll make this an array right here. Now I’m making a string. No, me.

Sorry. I split on BR. We’ll go like this. Anyway, watch I’m going to kind of get to this split. I’m BR two right there. Who knows what I’m doing here? It’s a mess, but it is don’t. Don’t that’s gross. Don’t do that. Don’t do what I’m doing here. Street, city, state, zip. And now the first one though, is going to be const perished name.

How to do that,

is that right? Is that going to be right? It’s assuming that has a comma here.

I make this slashing and said, I think our function will handle that.

Great escape. That that looks like it’s

like a real string

or whatever. I’m just gonna do it here. Do it live. We do it right here. Okay. Glad that that app, okay. Cons street equals split on VR and it’s going to be one concert. Citi and goals, but MBR two dot split on the comma like that. And then we have the state,

was it split in comics efforts one, and then we split on space and zero, don’t try this. Don’t don’t do this. This is for. I agree here. There we go. Now the name constant name equals MBR. Zero dot split on comma and wait to reverse him. Her name is split on comma equal split. Wait, wait, wait. How are we not doing this?

Look, they do it right here. Don’t they? No, they don’t. They just do the managers. Oh boy. That’s okay. We’re going to get this split name, a couple of ghosts, but I’m BR zero and then this one we’re rest, but on comma like that, and then we go, cause first name equals constant name because this is going to be as simple as name split on comma one.

And then we got this nice one, comma, two. That’s how easy it is now. We’ve got this. Now we have us and we go to the debt cost officer, I officer what a mess. Huh. And it’s going to be named, which is going to be named and I need to import this. Yeah. And then we go street address the street city, city, state.

State and zip zip. Now, I don’t think I know a title here. It’s the managers, but I don’t really know what that anyway. And we’re going to say if business officers, if it exists, then we say business officers dot push officer else. What do we do? We make it business officers equals officer. Officer bear so easy.

Right? Add officers, add officers right there. They’re so easy.

Okay. It’s going up with this. This should handle this. Probably don’t need to leave this in here anymore, but it’s going up anyway.

We have to wait for my actions to run. It’s running. I can see it running over here.

That’s the COVID STK here. And am I logging out? I’m not till the officers details up zero. That officer like that, I start running. Don’t worry. It’s coming. It takes a little bit longer with us. CICB. Come on. It’s almost there. We have 13 minutes. It was kinda took longer than I expected.

Come on. Almost there. Come on the NOI. I want it. This button so bad. The big miracle four works really. Right. I think I’m like 80, 75%, which is pretty good. It’s pretty competent. Okay. Then.

Come on, please, please, please come on offices to find for bruh, bruh,

what that means. You know what that means? I means this.

I know, I thought

label that trim.

No, it’s the same for all these other ones, but definitely doesn’t get here. Otherwise, we would have something, right. It has something in there.

hi, I’m harm, harm, harm. What’s the problem here. Then I’m gonna hit the logs here. Labeled trim. Is there.

It would appear to me.

Okay. Okay. Write this.

Name address, check. And we’re going with this name? Can I do that? Hold on. I want to go. Yes, I can. I want to go label that trim equals equals equals name dress. How I regarded that that’s some kind of stuff. Puts this again, and we’re going to wait again now. This isn’t fun when we’re waiting here. This is part of code.

Sorry guys. What’s screaming at the, deploy it out. It’s going right now. I will test it is in our dev environment here. So we can test this as much as we want. I have to look at the logs. See, look this to me. So I’m, I’m switching on all of these jurisdiction duration name, address, changed date, now, name, address.

This looks exactly the same. I think I would think my switch would be executives.

So what I expect now with that law, we added, I would expect all of these to be listed out there. And then they also have the comparison and then each one of these ones, I would expect it to be true. Now, if it is true, then maybe I’m crazy. Hopefully I guess I want it to be false because that’s would explain why it’s not working.

Hmm. Okay. Come on. Deploy, deploy, deploy, deploy, deploy, deploy.

And I brought back over to my STK and it get ready to run it. Come on. 17 minutes for just adding a simple officer. There we go there. I think we know our logs refresh this guy too. We find something so 56, here we go.

come on, come on, get our officer here for Atlanta. There we go see false, false, false, false, false, false, false, false, false, false.

Okay. It’s good. I guess. Right.

What’s the freaking difference? Well, I’m going to end it here. I feel confident with what we’re doing here. Something is weird. My comparison. There’s probably an extra something in there, like a line breaker or something it’s not displayed.

What would it be? I’m going to end up I’m into right there. 1831. That’s how we’re going to do it. We’re going to get this done. We’ll get them in there and it will be no problem. Thanks.

Hey there. Want to be friends?

I'll be straight with you. I'm going to want to show off my web scraping genius. But I want to hear about your web scraping troubles and successes as well.

And I like you. So I won't be one of those weird friends who is always calling. What do you say?