xpath for email addresses, usual methods don't work - xpath

I am trying to extract the third email address from this website:
https://www.usvotefoundation.org/vote/eoddomestic.htm;jsessionid=278032F9EB8FD34A6E9AD4D8E4C0F456?submission=true&stateId=1&regionId=430369
(the one for the chief election official), but I have not been able to do so. I have tried:
//*[#id="collapseEodContact"]/div/div/table/tbody[3]/tr[3]/td[2]/a
//a[starts-with(#href, "mailto")]/text()
//*[contains(text(), '#')]
In fact, I don't seem able to pick up any of the email addresses on the page, while being able to pick up other information, including other href attribute links links.
What am I missing?

Related

What code should I add (and where) on my website to track events/identify users on my website using segment.com?

I want to configure segment.com properly on my site and use it to manage all other apps/tools. I already installed the segment javascript on my site and used it as the source. Now, I am pushing these to MixPanel, Facebook, Google Analytics, etc.
What code should I add if I want to track an event and/or identify a user?
For simplicity's sake, i have a landing page (site.com/landing-page) with a form. After a successful submission, it redirects to a thank you page (site.com/thank-you-page).
The default settings already track the page views, and are pushing that same event to the different tools (FB: PageView, MixPanel: Loaded a Page, etc).
But in this case, i want to track the event and capture the person's information. And i don't know what to code to add and where.
My research so far
According to this article:
The best way to track new users is in client-side javascript on the welcome page after they signup, below we’ll explain why.
So, based on that, I add the code to my thank you page. But where? Header like adding GA scripts? body tag? I can add it anywhere, but i don't know where.
Next is what code should I add?
The example from the same article above:
When a new visitor goes to their site that visitor is anonymous. As soon as the visitor connects their Facebook account, Rdio knows who they are and creates a user record.
As part of that new user record the person is assigned a userId. Let’s say the new userId is 12345. Rdio will then need to fire the following calls on the welcome page:
analytics.identify('12345',{ name:'Jake Peterson', email:'friends#segment.com'});
analytics.track('Account Created',{ authentication:'Facebook'})
This gives me two problems: track and identify.
Track Problem
I'll start with the track. Based on how I understood this, assuming the event name i want to be added is "Downloaded PDF" then I want to store the title of it as well. It should look like this, right?
<script>
analytics.track('Downloaded PDF', {
title: 'Awesome Title'
});
</script>
Am I correct to enclose them inside <script> tags?
The tracking of an event seems a bit easier to understand that the identify part. But would love to know if i got that part right.
Identify Problem
Here, i have two questions:
where does userId come from? Is it automatically generated? For example, inside my MixPanel account, i see them. Is that what i use?
How do i reference to the userId? or any of the other traits I want to track in my code?
Taking from the same example above:
analytics.identify('12345',{ name:'Jake Peterson', email:'friends#segment.com'});
If i add this exact code on my thank you page, every signup will be assigned those values: '12345', 'Jake Peterson', and 'friends#segment.com', right?
What code should I add to (1) assign them the right userId (2) and get the name and email traits from the form of the previous page.
Let's say i'm only collecting first name and email.
analytics.identify("userId"{ firstName:"firstName", email:"email"});
If I add this code to my thank you page, will it automatically assign the userId, firstName, email values of the form that was submitted? That's the part I don't understand. What code to add to dynamically push the correct data.
And i know i'm not even adding the Alias part for MixPanel yet, but i just want to understand this part and the rest (hopefully) will be easier to understand.

Google Places Autocomplete 'address' types also allows street only addresses

This question here basically asks the same question:
Restrict Google Places Autocomplete to return addresses only
But doesn't get the right answer.
If we look at the official documentation examples they have an option to selected address type. However, on it, we can see that it will allow us to selected just streets:
Is there a way to make Places Autocomplete select real addresses only?
Since this question is quite old, the search result is now somehow different but the fact that address type returns street addresses remains the same.
And to clarify things here, the API is working as intended when it returns street addresses.
types=address seems to be quite vague and what you need to do is to be more specific if you don't want street address to be included.
Here's a table for reference on the different types of restrictions for autocomplete from the Place Types Documentation.
Table 3: Type collections supported in Place Autocomplete requests
The supported types are:
geocode instructs the Place Autocomplete service to return only geocoding results, rather than business results. Generally, you use this request to disambiguate results where the location specified may be indeterminate.
address instructs the Place Autocomplete service to return only geocoding results with a precise address. Generally, you use this request when you know the user will be looking for a fully specified address.
establishment instructs the Place Autocomplete service to return only business results.
(regions) type collection instructs the Places service to return any result matching the following types:
locality
sublocality
postal_code
country
administrative_area_level_1
administrative_area_level_2
(cities) type collection instructs the Places service to return results that match locality or administrative_area_level_3.
To further prove this, I tried using the official documentation example for testing.
I tried searching real street address with both types=address and types=geocode and they return street addresses as expected.
With address type:
With geocode type:
Then I tried the types=establishment and it did not return any street addresses.
With establishment type:
You can use any other types value apart from types=establishment like the (cities) and (regions). As long as you are specific in your restrictions, things will be working fine. You can just put some toggle on your app to change restrictions just like on the official docs example so that your end user could freely choose the restrictions. But it still depends on your use case.
Hope this helps.

Extract email address from view-source of website page

Trying to extract email address from page source of https://www.dice.com/jobs/detail/Process-Engineer-Lead-Kforce-Inc.-San-Antonio-TX-78288/kforcecx/ITWQG1496436?icid=sr1-1p&q=Senior%20Process%20Engineer&l=78288
I have list of links in columnA
ColumnB =importxml(A1, "//a[#href]/text()[contains(.,'#')]")
It is only extracting newdicesupport#dice.com not KJOHNSON#KFORCE.COM or any personal emails from page source.
Can you point out to me where is the wrong step in the code I took?.
That e-mail is inside a comment, so you need to access the comment (Accessing Comments in XML using XPath). Otherwise you can consider also 'input' nodes (that email is contained in the source, two times).

Can I obtain the country name with Google Places API?

On the request for current place I receive a list of places. Every place has an address but that address is a string so I can't get only the country name.
Could someone help me on this matter?
Country is only explicitly available when using the Place Details API, not the Places API. (https://developers.google.com/maps/documentation/places/web-service/details)
You first need to look up a place_id for the specific place you're looking for. You then use your place_id to pull details from the Details API, which includes information like:
Fully formatted address, including country
Address components
Sample reviews
Phone # and website
Operating hours
If you have read the Google Places Autocomplete doc,you must know about API properties.you can use the type as '(region)' and will return you many results (plus country).And if you look inside address_components field (it's array with dynamic length),you will see,that the last item of array is what you need.Here is a great page to read a correct doc and try examples yourself.
http://www.w3docs.com/learn-javascript/places-autocomplete.html

Is this possible to valid the domain is belongs to somebody?

For example, I have a field that give user to type their domain, the user can type any domain on this, but I don't valid this domain is belong that user. Of course, I can generate a random number text file for user to upload, and when I get the random number text file, if it is match, I can just treat it as a valid domain holder. But, except from this method, is that anyway to do so? Thanks.
Options I have seen:
Have user Create a Text file in document root, check for it
Send Email to contacts listed in whois (Or other ROLE type accounts (postmaster, hostmaster, etc...), with token they need to
return
Have them create an 'A' record in their DNS that is unique and you can query for.
There really isn't any other way of telling if they have control over the domain. Using whois information isn't 100% accurate as people don't update it, or their info isn't registered to them, or is hidden behind something like domains by proxy. There is no standard information in DNS, that can tell you ownership. Since google uses the DNS method and the text file method (I think), you can probably safely assume that is a good way to verify it.

Resources